应用程序是如何从android框架启动的

时间:2016-09-10 21:33:35

标签: android

我正在进行概念验证,我想从android框架源代码中的类启动一个应用程序(/frameworks/base/core/java/android/database/sqlite/SQLiteDatabase.java)

我尝试使用以下代码:

Context context = new Context(); //This is not right
ActivityManager am = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
Intent intent = new Intent(Intent.ACTION_VIEW);
am.startActivity(context, intent, null);

由于我没有或者不知道如何获取对Context对象的引用,因此上面的代码不起作用。

关于如何最好地从android框架中的类启动应用程序的任何建议?

0 个答案:

没有答案