@@ -64,16 +64,16 @@ private void initViews(PluginDescriptor pluginDescriptor) {
64
64
65
65
LinearLayout pluginView = (LinearLayout ) mRoot .findViewById (R .id .plugin_items );
66
66
67
- addButton (pluginView , pluginDescriptor .getFragments (), "Fragment" );
67
+ addButton (pluginView , pluginDescriptor .isStandalone (), pluginDescriptor . getFragments (), "Fragment" );
68
68
69
- addButton (pluginView , pluginDescriptor .getActivitys (), "Activity" );
69
+ addButton (pluginView , pluginDescriptor .isStandalone (), pluginDescriptor . getActivitys (), "Activity" );
70
70
71
- addButton (pluginView , pluginDescriptor .getServices (), "Service" );
71
+ addButton (pluginView , pluginDescriptor .isStandalone (), pluginDescriptor . getServices (), "Service" );
72
72
73
- addButton (pluginView , pluginDescriptor .getReceivers (), "Receiver" );
73
+ addButton (pluginView , pluginDescriptor .isStandalone (), pluginDescriptor . getReceivers (), "Receiver" );
74
74
}
75
75
76
- private void addButton (LinearLayout pluginView , HashMap map , final String type ) {
76
+ private void addButton (LinearLayout pluginView , final boolean isStandalone , HashMap map , final String type ) {
77
77
Iterator <String > keys = map .keySet ().iterator ();
78
78
while (keys .hasNext ()) {
79
79
@@ -101,7 +101,9 @@ public void onClick(View v) {
101
101
Intent intent = new Intent ();
102
102
intent .setClassName (DetailActivity .this , entry );
103
103
intent .putExtra ("testParam" , "testParam" );
104
- intent .putExtra ("paramVO" , new SharePOJO ("测试VO" ));
104
+ if (!isStandalone ) {
105
+ intent .putExtra ("paramVO" , new SharePOJO ("测试VO" ));
106
+ }
105
107
startService (intent );
106
108
// stopService(intent);
107
109
@@ -110,15 +112,19 @@ public void onClick(View v) {
110
112
Intent intent = new Intent ();
111
113
intent .setClassName (DetailActivity .this , entry );
112
114
intent .putExtra ("testParam" , "testParam" );
113
- intent .putExtra ("paramVO" , new SharePOJO ("测试VO" ));
115
+ if (!isStandalone ) {
116
+ intent .putExtra ("paramVO" , new SharePOJO ("测试VO" ));
117
+ }
114
118
sendBroadcast (intent );
115
119
116
120
} else if (type .equals ("Activity" )) {// 这个判断仅仅是为了方便debug,在实际开发中,类型一定是已知的
117
121
118
122
Intent intent = new Intent ();
119
123
intent .setClassName (DetailActivity .this , entry );
120
124
intent .putExtra ("testParam" , "testParam" );
121
- intent .putExtra ("paramVO" , new SharePOJO ("测试VO" ));
125
+ if (!isStandalone ) {
126
+ intent .putExtra ("paramVO" , new SharePOJO ("测试VO" ));
127
+ }
122
128
startActivity (intent );
123
129
124
130
} else if (type .equals ("Fragment" )) {
0 commit comments