0
我有一个listview,图像和每行两行。在第一行中,我有一个简单的文本存储在一个数组中,第二行也是,但我想知道它是如何动态改变已安装或未安装应用程序状态的第二行。在列表视图行中打印应用程序的安装状态Android
这是代码:
字符串[]工具=新的String [] { “工具1”, “工具2”, “工具3”, “工具4”, “工具5“ };
// Array integer que apunta a las imagenes en /res/drawable-ldpi/
int[] flags = new int[]{
R.drawable.image1,
R.drawable.image2,
R.drawable.image3,
R.drawable.image4,
R.drawable.image5
};
// Array string donde van la descripcion
String[] status = new String[]{
"Status",
"Status",
"Status",
"Status",
"Status"
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.anonimato);
List<HashMap<String,String>> aList = new ArrayList<HashMap<String,String>>();
for(int i=0;i<5;i++){
HashMap<String, String> hm = new HashMap<String,String>();
hm.put("txt", tools[i]);
hm.put("cur", status[i]);
hm.put("flag", Integer.toString(flags[i]));
aList.add(hm);
}
String[] from = { "flag","txt","cur" };
int[] to = { R.id.flag,R.id.txt,R.id.cur};
SimpleAdapter adapter = new SimpleAdapter(getBaseContext(), aList, R.layout.listview_layout, from, to);
此链接How to check programmatically if an application is installed or not in Android?我具备的功能,以了解是否安装与否的应用程序,但我怎么能状态数组中加载它?以及如何将其添加到我的来源?
感谢我被怀疑做这样的事情。有一个问题。有一个简单的方法来检查apk是否安装?我编程了一些东西但没有工作。 http://pastebin.com/6kJKNHAA,感谢您的帮助,我真的赞叹它:) – ruben
检查我编辑的答案 –
哦,很酷,让我试试它(现在我没有完整的代码在这里),我会给你我的意见!,多谢 – ruben