【发布时间】:2015-04-11 10:28:26
【问题描述】:
我是新的小部件。我研究了一些关于使用 texview 和按钮的小部件的教程。我不知道更多关于使用列表视图。有一个名为 list_item.xml 的 xml 文件
list_item_xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dip"
android:textSize="16dip"
android:textStyle="bold" >
</TextView>
和活动代码
AndroidListViewActivity.java
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// storing string resources into Array
String[] adobe_products = getResources().getStringArray(R.array.adobe_products);
// Binding Array to ListAdapter
this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.label, adobe_products));
}}
如何在 android 中将此活动作为小部件。
【问题讨论】:
标签: android android-intent widget android-widget