forked from Samsung/microbit
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathNotificationActivity.java
More file actions
49 lines (37 loc) · 1.4 KB
/
NotificationActivity.java
File metadata and controls
49 lines (37 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.samsung.microbit.ui.activity;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import com.samsung.microbit.R;
public class NotificationActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO: EdgeToEdge - Remove once activities handle insets.
// Call before the DecorView is accessed in setContentView
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
super.onCreate(savedInstanceState);
// If this activity is the root activity of the task, the app is not running
if(isTaskRoot()) {
// Start the app before finishing
final Intent intent = new Intent(this, HomeActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtras(getIntent().getExtras()); // copy all extras
startActivity(intent);
}
// Now finish, which will drop you to the activity at which you were at the top of the task stack
finish();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
}
}