Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android instrumentation.execStartActivity参数_Android_Multithreading_Instrumentation_Android Binder - Fatal编程技术网

Android instrumentation.execStartActivity参数

Android instrumentation.execStartActivity参数,android,multithreading,instrumentation,android-binder,Android,Multithreading,Instrumentation,Android Binder,有点麻烦。我正在尝试使用另一个活动启动一个活动,需要获取instrumentation.java类中execStartActivity方法的7个参数 据我所知,方法如下: execStartActivity( Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options) { 假设我的起始活动称为Main

有点麻烦。我正在尝试使用另一个活动启动一个活动,需要获取instrumentation.java类中execStartActivity方法的7个参数

据我所知,方法如下:

    execStartActivity(
    Context who, IBinder contextThread, IBinder token, Activity target,
    Intent intent, int requestCode, Bundle options) {
假设我的起始活动称为MainActivity。显然,如文档中所述,who参数是我的基本活动,因此它将由getApplicationContext()调用。下一个参数是我被卡住的地方。如何为IBinder获取contextThread?我试过:

    Looper.getMainLooper().getThread() 

IBinder令牌的另一个特点是,您只是将一些任意字符串指定为“令牌”值来表示您的开始活动?下一个参数是您的主类的开始活动,但是意图应该是类似于:

    new Intent(this, SecondClass.class)? 
如果我试图加载另一个应用程序呢

其意图是否为packagename,例如:

    ("com.example.application2", null)?
我只是在请求代码中加了-1,但我也被捆绑选项卡住了(我只是把它留空了)

我们能自动得到这些参数吗?我是否应该尝试手动使用仪器

任何帮助都将不胜感激

    ("com.example.application2", null)?