本文整理了Java中android.content.Intent.fillIn()
方法的一些代码示例,展示了Intent.fillIn()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Intent.fillIn()
方法的具体详情如下:
包路径:android.content.Intent
类名称:Intent
方法名:fillIn
暂无
代码示例来源:origin: robolectric/robolectric
@Test
public void shouldFillIn() throws Exception {
Intent intentA = new Intent();
Intent intentB = new Intent();
intentB.setAction("foo");
Uri uri = Uri.parse("http://www.foo.com");
intentB.setDataAndType(uri, "text/html");
String category = "category";
intentB.addCategory(category);
intentB.setPackage("com.foobar.app");
ComponentName cn = new ComponentName("com.foobar.app", "fragmentActivity");
intentB.setComponent(cn);
intentB.putExtra("FOO", 23);
int flags = Intent.FILL_IN_ACTION |
Intent.FILL_IN_DATA |
Intent.FILL_IN_CATEGORIES |
Intent.FILL_IN_PACKAGE |
Intent.FILL_IN_COMPONENT;
int result = intentA.fillIn(intentB, flags);
assertEquals("foo", intentA.getAction());
assertSame(uri, intentA.getData());
assertEquals("text/html", intentA.getType());
assertTrue(intentA.getCategories().contains(category));
assertEquals("com.foobar.app", intentA.getPackage());
assertSame(cn, intentA.getComponent());
assertEquals(23, intentA.getIntExtra("FOO", -1));
assertEquals(result, flags);
}
代码示例来源:origin: robolectric/robolectric
lastIntentCopy.fillIn(intent, 0);
intentsToSend[intentsToSend.length - 1] = lastIntentCopy;
} else {
代码示例来源:origin: stackoverflow.com
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK){
Intent showImageIntent = new Intent(this, ShowCameraPicture.class);
showImageIntent.fillIn(data,Intent.FILL_IN_DATA);
startActivity(showImageIntent);
}
}
代码示例来源:origin: com.github.japgolly.android.test/robolectric
@Implementation
public void send(Context context, int code, Intent intent) throws CanceledException {
savedIntent.fillIn(intent, 0 );
if (isActivityIntent) {
context.startActivity(savedIntent);
} else if (isBroadcastIntent) {
context.sendBroadcast(savedIntent);
} else if (isServiceIntent) {
context.startService(savedIntent);
}
}
代码示例来源:origin: org.robolectric/framework
@Implementation
public void send(Context context, int code, Intent intent) throws CanceledException {
if (intent != null) {
for (Intent savedIntent : savedIntents) {
savedIntent.fillIn(intent, 0);
}
}
if (isActivityIntent) {
for (Intent savedIntent : savedIntents) {
context.startActivity(savedIntent);
}
} else if (isBroadcastIntent) {
for (Intent savedIntent : savedIntents) {
context.sendBroadcast(savedIntent);
}
} else if (isServiceIntent) {
for (Intent savedIntent : savedIntents) {
context.startService(savedIntent);
}
}
}
代码示例来源:origin: org.robolectric/shadows-core
@Implementation
public void send(Context context, int code, Intent intent) throws CanceledException {
if (intent != null) {
for (Intent savedIntent : savedIntents) {
savedIntent.fillIn(intent, 0);
}
}
if (isActivityIntent) {
for (Intent savedIntent : savedIntents) {
context.startActivity(savedIntent);
}
} else if (isBroadcastIntent) {
for (Intent savedIntent : savedIntents) {
context.sendBroadcast(savedIntent);
}
} else if (isServiceIntent) {
for (Intent savedIntent : savedIntents) {
context.startService(savedIntent);
}
}
}
代码示例来源:origin: org.robolectric/shadows-core-v23
@Implementation
public void send(Context context, int code, Intent intent) throws CanceledException {
if (intent != null) {
for (Intent savedIntent : savedIntents) {
savedIntent.fillIn(intent, 0);
}
}
if (isActivityIntent) {
for (Intent savedIntent : savedIntents) {
context.startActivity(savedIntent);
}
} else if (isBroadcastIntent) {
for (Intent savedIntent : savedIntents) {
context.sendBroadcast(savedIntent);
}
} else if (isServiceIntent) {
for (Intent savedIntent : savedIntents) {
context.startService(savedIntent);
}
}
}
代码示例来源:origin: NordicSemiconductor/Android-DFU-Library
newIntent.fillIn(intent, Intent.FILL_IN_COMPONENT | Intent.FILL_IN_PACKAGE);
restartService(newIntent, scanForBootloader);
代码示例来源:origin: NordicSemiconductor/Android-DFU-Library
newIntent.fillIn(intent, Intent.FILL_IN_COMPONENT | Intent.FILL_IN_PACKAGE);
代码示例来源:origin: org.robolectric/shadows-framework
lastIntentCopy.fillIn(intent, 0);
intentsToSend[intentsToSend.length - 1] = lastIntentCopy;
} else {
代码示例来源:origin: NordicSemiconductor/Android-DFU-Library
newIntent.fillIn(intent, Intent.FILL_IN_COMPONENT | Intent.FILL_IN_PACKAGE);
restartService(newIntent, false);
代码示例来源:origin: NordicSemiconductor/Android-DFU-Library
newIntent.fillIn(intent, Intent.FILL_IN_COMPONENT | Intent.FILL_IN_PACKAGE);
newIntent.putExtra(EXTRA_ATTEMPT, 1);
startService(newIntent);
代码示例来源:origin: NordicSemiconductor/Android-DFU-Library
newIntent.fillIn(intent, Intent.FILL_IN_COMPONENT | Intent.FILL_IN_PACKAGE);
restartService(newIntent, /* scan only for SDK 6.1, see Pull request #45 */ mVersion == 0);
内容来源于网络,如有侵权,请联系作者删除!