@@ -126,7 +126,7 @@ public void onClick(View v) {
126
126
} else if (v .getId () == R .id .weixin ) {
127
127
128
128
//通过packageManager查询其他插件信息, 微信插件中没有配置launcher,所以这里用字符串“Send”来匹配
129
- PackageManager packageManager = ( PackageManager ) getSystemService ( "package_manager" );
129
+ PackageManager packageManager = getPackageManager ( );
130
130
try {
131
131
PackageInfo info = packageManager .getPackageInfo ("com.example.wxsdklibrary" , PackageManager .GET_ACTIVITIES );
132
132
@@ -146,7 +146,7 @@ public void onClick(View v) {
146
146
147
147
} else if (v .getId () == R .id .hellow ) {
148
148
//通过packageManager查询其他插件信息
149
- PackageManager packageManager = ( PackageManager ) getSystemService ( "package_manager" );
149
+ PackageManager packageManager = getPackageManager ( );
150
150
Intent intent = packageManager .getLaunchIntentForPackage ("com.example.pluginhelloworld" );
151
151
startActivity (intent );
152
152
}
@@ -167,7 +167,6 @@ private void testNotification() {
167
167
//还可以支持唤起service、receiver等等。
168
168
169
169
intent .putExtra ("param1" , "这是来自通知栏的参数" );
170
- intent = NotificationHelper .resolveNotificationIntent (intent , 2 /*PluginDescriptor.ACTIVITY*/ );
171
170
172
171
PendingIntent contentIndent = PendingIntent .getActivity (this , 0 , intent ,
173
172
PendingIntent .FLAG_UPDATE_CURRENT );
@@ -182,7 +181,7 @@ private void testNotification() {
182
181
if (Build .VERSION .SDK_INT >=21 ) {
183
182
try {
184
183
//获取当前插件的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 ;
186
185
187
186
RemoteViews remoteViews = NotificationHelper .createRemoteViews (
188
187
R .layout .plugin_notification ,
0 commit comments