@@ -74,49 +74,50 @@ public class MyMainActivity extends Activity {
74
74
private TweakStore tweakStore;
75
75
private NotificationManager notificationManager;
76
76
77
- @Override
78
- protected void onCreate (Bundle savedInstanceState ) {
79
- super . onCreate(savedInstanceState);
80
-
81
- tweakStore = TweakStore . getInstance(this );
82
- tweakStore. setTweaks(BAXTweaks . allTweaks);
83
- tweakStore. setEnabled(BuildConfig . TWEAKS_ENABLED );
84
-
85
- if (tweakStore. isEnabled()) {
86
- showNotification();
87
- }
88
- }
89
-
90
- @Override
91
- protected void onStart () {
92
- super . onStart();
93
- if (tweakStore. isEnabled()) {
94
- showNotification();
77
+ @Override
78
+ protected void onCreate (Bundle savedInstanceState ) {
79
+ super . onCreate(savedInstanceState);
80
+
81
+ tweakStore = TweakStore . getInstance(this );
82
+ tweakStore. setTweaks(BAXTweaks . allTweaks);
83
+ tweakStore. setEnabled(BuildConfig . TWEAKS_ENABLED );
84
+
85
+ if (tweakStore. isEnabled()) {
86
+ showNotification();
87
+ }
95
88
}
96
- }
97
-
98
- @Override
99
- protected void onStop () {
100
- super . onStop();
101
- notificationManager. cancelAll();
102
- }
103
-
104
- private void showNotification () {
105
- NotificationCompat . Builder notificationBuilder = new NotificationCompat .Builder (this );
106
89
107
- notificationBuilder. setSmallIcon(app_icon_from_resources);
108
- notificationBuilder. setContentTitle(text_from_resources);
109
- notificationBuilder. setPriority(Notification . PRIORITY_MAX );
110
- notificationBuilder. setWhen(0 );
111
- notificationBuilder. setDefaults(Notification . DEFAULT_SOUND );
90
+ @Override
91
+ protected void onStart () {
92
+ super . onStart();
93
+ if (tweakStore. isEnabled()) {
94
+ showNotification();
95
+ }
96
+ }
112
97
113
- Intent intent = new Intent (this , TweakStoreActivity . class);
114
- intent. putExtra(TWEAK_STORE_NAME , tweakStore. getTweakStoreName());
115
- PendingIntent pendingIntent = PendingIntent . getActivity(this , 0 , intent, PendingIntent . FLAG_UPDATE_CURRENT );
116
- notificationBuilder. addAction(button_icon_from_resources, button_text_from_resources, pendingIntent);
98
+ @Override
99
+ protected void onStop () {
100
+ super . onStop();
101
+ notificationManager. cancelAll();
102
+ }
117
103
118
- notificationManager = (NotificationManager ) getSystemService(NOTIFICATION_SERVICE );
119
- notificationManager. notify(1 , notificationBuilder. build());
104
+ private void showNotification () {
105
+ NotificationCompat . Builder notificationBuilder = new NotificationCompat .Builder (this );
106
+
107
+ notificationBuilder. setSmallIcon(app_icon_from_resources);
108
+ notificationBuilder. setContentTitle(text_from_resources);
109
+ notificationBuilder. setPriority(Notification . PRIORITY_MAX );
110
+ notificationBuilder. setWhen(0 );
111
+ notificationBuilder. setDefaults(Notification . DEFAULT_SOUND );
112
+
113
+ Intent intent = new Intent (this , TweakStoreActivity . class);
114
+ intent. putExtra(TWEAK_STORE_NAME , tweakStore. getTweakStoreName());
115
+ PendingIntent pendingIntent = PendingIntent . getActivity(this , 0 , intent, PendingIntent . FLAG_UPDATE_CURRENT );
116
+ notificationBuilder. addAction(button_icon_from_resources, button_text_from_resources, pendingIntent);
117
+
118
+ notificationManager = (NotificationManager ) getSystemService(NOTIFICATION_SERVICE );
119
+ notificationManager. notify(1 , notificationBuilder. build());
120
+ }
120
121
}
121
122
```
122
123
0 commit comments