为什么信息无法在我的微调器中显示 [英] Why information unable to display in my spinner
本文介绍了为什么信息无法在我的微调器中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么我的代码无法显示微调器?我的textview工作正常,但微调器无法工作。我已经输入了数据库的信息
NearablesDemoActivity.java
Why is it my code is unable to display the spinner? My textview works fine but the spinner unable to work. I have already enter the information for the database
NearablesDemoActivity.java
private void displayCurrentNearableInfo() {
stickerdb = new Database_sticker(this);
dbRow = stickerdb.getResult(currentNearable.identifier);
dbRow.getId();
dbRow.getIdentifier();
//dbRow.getSa();
//dbRow.getCa();
String desc = dbRow.getDesc().toString();
String sa = dbRow.getSa().toString();
String ca = dbRow.getCa().toString();
String coo = dbRow.getCoo().toString();
String sm = dbRow.getSm().toString();
String price = dbRow.getPrice().toString();
//Set the text to the TextView
Desc.setText(desc);
SA.setText(sa);
CA.setText(ca);
COO.setText(coo);
SM.setText(sm);
Price.setText(price);
}
ListNearablesActivity.java
ListNearablesActivity.java
private AdapterView.OnItemClickListener createOnItemClickListener() {
return new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, final int position, long id) {
if (getIntent().getStringExtra(EXTRAS_TARGET_ACTIVITY) != null){
try {
Class<?> clazz = Class.forName(getIntent().getStringExtra(EXTRAS_TARGET_ACTIVITY));
Intent intent = new Intent(ListNearablesActivity.this, clazz);
intent.putExtra(EXTRAS_NEARABLE, adapter.getItem(position));
startActivity(intent);
} //close for try
catch (ClassNotFoundException e) {
Log.e(TAG, "Finding class by name failed", e);
} //close for catch (ClassNotFoundException e)
} //close for getintent.getStringExtra()
} //close for public void onitemclick
}; //close for return new adapterview
} //close for private adapter
推荐答案
你已经在为什么我的textview和spinner上没有显示信息 [ ^ ]。请不要重新发布相同的问题。
You already asked this at Why no information display on my textview and spinner[^]. Please do not repost the same question.
这篇关于为什么信息无法在我的微调器中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文