我只想從應用程序,我開發的軟件包名稱動態地啓動一些應用程序,我已經嘗試過這樣的:Android有沒有方法以編程方式啓動應用程序而不添加到清單?
intent = new Intent(Intent.ACTION_VIEW);
component = new ComponentName(getApplicationContext(), myPrefs.getString("Combo1", null));
Log.i("LOG", myPrefs.getString("Combo1", null));
intent.setComponent(component);
和
intent = pm.getLaunchIntentForPackage(myPrefs.getString("Combo1", null));
startActivity(intent);
兩個作品和多個應用程序打開,但爲他人我得到這個錯誤。
11-29 21:42:08.723: E/AndroidRuntime(4719): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.lock/com.sec.android.app.phoneutil}; have you declared this activity in your AndroidManifest.xml?
我理解錯誤(我需要添加在清單中的應用程序/活動),所以我想知道,如果是一個解決方法,以動態添加活動來體現,或者有一個動態的啓動方式應用程序中不添加應用程序/活動的清單,或者有允許打開應用程序的權限?
從我的研究看來,這似乎是不可能的,但我想知道專家的意見。
Thanx提前。
出於好奇,你爲什麼要這麼做? – vanleeuwenbram
請參閱http://stackoverflow.com/questions/5374323/add-activities-programmatically-in-android –
我想製作一個啓動差異的應用程序。應用程序動態從您的手機 – djcharon