|
1.。Intent startIntent = new Intent();ComponentName componentName = new ComponentName(
"com.smarteye.mcu",
"com.smarteye.mcu.BroadcastStartActivity");
startIntent.setComponent(componentName);
startIntent.addFlags(FLAG_ACTIVITY_NEW_TASK);
startIntent.putExtra("package", getPackageName());// 调用者App包名
startActivity(startIntent);
2.Intent intent = new Intent();intent.setAction("mcp.intent.action.MCP_LOGIN");
intent.setPackage("com.smarteye.mcu");
BroadcastLoginInfoEntity loginInfo = new BroadcastLoginInfoEntity();
loginInfo.iProtoType = 0;
loginInfo.szServerAddr = "192.168.0.128";
loginInfo.iServerPort = 9701;
loginInfo.szUserType = "UA";
loginInfo.szEncodeType = "none";
loginInfo.szUserName = "wang";
loginInfo.szPassword = "aaa111";
String value = (new Gson()).toJson(loginInfo);
Log.i("ttt",value);
intent.putExtra("msg", value);
intent.putExtra("package", "com.hao.talkim");
sendBroadcast(intent);
|
|