5
结果我开发一个应用程序,应该返回一些文本,以启动该意图的应用程序。启动活动从IME
但是启动的意图应用程序是一个IME /软键盘。 因此,StartActivityForResult不可用,因为IME是一项服务。
我该如何做到这一点?
我走到这一步:
键盘:
final Intent intent = new Intent("com.example.helloworld.GETTEXT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
intent.putExtra("keyboard", true);
startActivity(intent);
其他应用程序:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Bundle extras = getIntent().getExtras();
if (extras == null){
return;
} else {
finish();
}
}
@Override
public void finish() {
Intent data = new Intent();
data.putExtra("test", "PASSED");
setResult(RESULT_OK, data);
super.finish();
}
你不能使用这个广播接收器? –