나는 설치된 응용 프로그램을 모두 나열하는 ListApp 활동을 가지고 있습니다. 여기서 내가하려고하는 것은 사용자가 목록에서 선택한 응용 프로그램에 대한 인 텐트/정보를 얻어야하는 응용 프로그램을 선택할 때입니다 사용자가 button1을 클릭하면 이전에 선택했던 앱을 (이전에 검색 한 인 텐트의 도움으로) 열어야합니다.의도로 활동 시작
ListApp 활동 :
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
switch (arg0.getId()){
case R.id.button1:
//startActivity(app.intent);
//should start app with the help of info received by selecting app from the list
break;
}
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
//ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
//startActivity(app.intent);
//instead of launching app, I would like to get the info about the selected app & use it(start app) when clicking button1
}
ApplicationInfo
class ApplicationInfo {
CharSequence title;
Intent intent;
Drawable icon;
boolean filtered;
final void setActivity(ComponentName className, int launchFlags) {
intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(className);
intent.setFlags(launchFlags);
}
}
감사합니다 모든 사람 :
무엇이 문제입니까/문제입니까? –