本文整理汇总了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));
}