Skip to content

Commit 117c620

Browse files
committed
Update Demo
1 parent 6b6de20 commit 117c620

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

PluginTest/src/com/example/plugintest/activity/PluginTestActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void onCreate(Bundle savedInstanceState) {
3939

4040
Log.d("xx", getApplication().toString() + "," + getApplicationContext().toString() + "," + getApplication().getApplicationContext().toString());
4141

42-
Log.d("xx", ((ParamVO)getIntent().getSerializableExtra("paramvo")) + ", action:" + getIntent().getAction());
42+
Log.d("xx", ((ParamVO)getIntent().getSerializableExtra("paramvo")) + ", action:" + getIntent().getAction() + getIntent().toUri(0));
4343

4444
mInflater = getLayoutInflater();
4545
View scrollview = mInflater.inflate(R.layout.plugin_layout, null);

PluginTest/src/com/example/plugintest/activity/PluginWebViewActivity.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public void onClick(View v) {
126126
} else if (v.getId() == R.id.weixin) {
127127

128128
//通过packageManager查询其他插件信息, 微信插件中没有配置launcher,所以这里用字符串“Send”来匹配
129-
PackageManager packageManager = (PackageManager)getSystemService("package_manager");
129+
PackageManager packageManager = getPackageManager();
130130
try {
131131
PackageInfo info = packageManager.getPackageInfo("com.example.wxsdklibrary", PackageManager.GET_ACTIVITIES);
132132

@@ -146,7 +146,7 @@ public void onClick(View v) {
146146

147147
} else if (v.getId() == R.id.hellow) {
148148
//通过packageManager查询其他插件信息
149-
PackageManager packageManager = (PackageManager)getSystemService("package_manager");
149+
PackageManager packageManager = getPackageManager();
150150
Intent intent = packageManager.getLaunchIntentForPackage("com.example.pluginhelloworld");
151151
startActivity(intent);
152152
}
@@ -167,7 +167,6 @@ private void testNotification() {
167167
//还可以支持唤起service、receiver等等。
168168

169169
intent.putExtra("param1", "这是来自通知栏的参数");
170-
intent = NotificationHelper.resolveNotificationIntent(intent, 2/*PluginDescriptor.ACTIVITY*/);
171170

172171
PendingIntent contentIndent = PendingIntent.getActivity(this, 0, intent,
173172
PendingIntent.FLAG_UPDATE_CURRENT);
@@ -182,7 +181,7 @@ private void testNotification() {
182181
if (Build.VERSION.SDK_INT >=21) {
183182
try {
184183
//获取当前插件的packageName
185-
String currentPackageName = ((PackageManager)getSystemService("package_manager")).getActivityInfo(new ComponentName(this.getPackageName(), this.getClass().getName()), 0).packageName;
184+
String currentPackageName = getPackageManager().getActivityInfo(new ComponentName(this.getPackageName(), this.getClass().getName()), 0).packageName;
186185

187186
RemoteViews remoteViews = NotificationHelper.createRemoteViews(
188187
R.layout.plugin_notification,

0 commit comments

Comments
 (0)