本文整理匯總了Java中android.widget.TextView.setKeyListener方法的典型用法代碼示例。如果您正苦於以下問題:Java TextView.setKeyListener方法的具體用法?Java TextView.setKeyListener怎麽用?Java TextView.setKeyListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.TextView
的用法示例。
在下文中一共展示了TextView.setKeyListener方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initView
import android.widget.TextView; //導入方法依賴的package包/類
private void initView(){
View view = mInflater.inflate(R.layout.widet_num_add_sub,this,true);
mEtxtNum = (TextView) view.findViewById(R.id.etxt_num);
mEtxtNum.setInputType(InputType.TYPE_NULL);
mEtxtNum.setKeyListener(null);
mBtnAdd = (Button) view.findViewById(R.id.btn_add);
mBtnSub = (Button) view.findViewById(R.id.btn_sub);
mBtnAdd.setOnClickListener(this);
mBtnSub.setOnClickListener(this);
}
示例2: initView
import android.widget.TextView; //導入方法依賴的package包/類
private void initView() {
View view = mInflater.inflate(R.layout.widet_num_add_sub, this, true);
mEtxtNum = (TextView) view.findViewById(R.id.etxt_num);
mEtxtNum.setInputType(InputType.TYPE_NULL);
mEtxtNum.setKeyListener(null);
mBtnAdd = (Button) view.findViewById(R.id.btn_add);
mBtnSub = (Button) view.findViewById(R.id.btn_sub);
mBtnAdd.setOnClickListener(this);
mBtnSub.setOnClickListener(this);
}
示例3: onCreate
import android.widget.TextView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Retrieve the content view that renders the map.
setContentView(R.layout.activity_maps);
// Add title
getSupportActionBar().setTitle("Event Details");
// Add Back button
android.support.v7.app.ActionBar actionBar = getSupportActionBar();
if(actionBar != null){
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
// Get intent
Intent intename = getIntent();
// nameString = (String) intename.getSerializableExtra("NAME");
// timeString = (String) intename.getSerializableExtra("TIME");
nameString = "lalala";
timeString = "24:00";
descriptionString = (String) intename.getSerializableExtra("PostText");
lat = (double) intename.getSerializableExtra("LAT");
lng = (double) intename.getSerializableExtra("LNG");
// zipcodeString = (String) intename.getSerializableExtra("ZIPCODE");
// addressString = (String) intename.getSerializableExtra("ADDRESS");
zipcodeString = "02215";
addressString = "PHO";
location = new LatLng(lat, lng);
// Get the SupportMapFragment and request notification
// when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
// Get TextView
name = (TextView) findViewById(R.id.Name);
time = (TextView) findViewById(R.id.Time);
description = (TextView) findViewById(R.id.Description);
// Get Button
mapAppCtrl = (Button) findViewById(R.id.openMap);
mapAppCtrl.setOnClickListener(new MapsMarkerActivity.ButtonClickHandler());
// Set TextView uneditable
name.setKeyListener(null);
time.setKeyListener(null);
description.setKeyListener(null);
// Set TextView size and bold
name.setTextSize(20);
time.setTextSize(10);
TextPaint paint = name.getPaint();
paint.setFakeBoldText(true);
//Set content
name.setText(nameString);
time.setText(timeString);
description.setText(String.format("%s\n%s\n%s", descriptionString, addressString, zipcodeString));
}