优化通知跳转逻辑
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity2"
|
android:name=".MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
|
|||||||
@@ -5,27 +5,22 @@ import android.content.pm.PackageInfo;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
import com.google.android.gms.tasks.OnCompleteListener;
|
|
||||||
import com.google.android.gms.tasks.Task;
|
|
||||||
import com.google.firebase.messaging.FirebaseMessaging;
|
import com.google.firebase.messaging.FirebaseMessaging;
|
||||||
import com.web.base.MainActivity;
|
|
||||||
|
|
||||||
public class MainActivity2 extends com.web.base.MainActivity2 {
|
public class MainActivity extends com.web.base.MainActivity2 {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
userId = 128;
|
userId = 128;
|
||||||
saveInt(MainActivity2.this,"user_code",userId);
|
saveInt(MainActivity.this,"user_code",userId);
|
||||||
saveInt(MainActivity2.this,"version_code",getVersion());
|
saveInt(MainActivity.this,"version_code",getVersion());
|
||||||
MainActivity.saveString(this, "base_url","https://freeaud.asia/");
|
com.web.base.MainActivity.saveString(this, "base_url","https://freeaud.asia/");
|
||||||
//网页的底部NavigationBar颜色
|
//网页的底部NavigationBar颜色
|
||||||
MainActivity.saveString(this, "style_color", "#131313");
|
com.web.base.MainActivity.saveString(this, "style_color", "#131313");
|
||||||
//页面的大背景颜色
|
//页面的大背景颜色
|
||||||
MainActivity.saveString(this, "windows_color", "#0d0008");
|
com.web.base.MainActivity.saveString(this, "windows_color", "#0d0008");
|
||||||
//任务栏的文字颜色 0 黑 1白 默认黑
|
//任务栏的文字颜色 0 黑 1白 默认黑
|
||||||
saveInt(MainActivity2.this,"is_white",1);
|
saveInt(MainActivity.this,"is_white",1);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
//用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色
|
//用于修改大背景渐变色 不设置 大背景就是 windows_color 的颜色
|
||||||
setBackDrawables(R.drawable.big_bg);
|
setBackDrawables(R.drawable.big_bg);
|
||||||
@@ -48,7 +48,7 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showNotification(MessageInfo messageInfo) {
|
private void showNotification(MessageInfo messageInfo) {
|
||||||
Intent notifyIntent = new Intent(this, com.web.base.MainActivity2.class);
|
Intent notifyIntent = new Intent(this, MainActivity.class);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
|
||||||
ComponentName launchComponent = null;
|
ComponentName launchComponent = null;
|
||||||
launchComponent = getApplication()
|
launchComponent = getApplication()
|
||||||
@@ -100,7 +100,7 @@ public class MyFirebaseMessageingService extends FirebaseMessagingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showNotification(String title, String body) {
|
private void showNotification(String title, String body) {
|
||||||
Intent notifyIntent = new Intent(this, MainActivity2.class);
|
Intent notifyIntent = new Intent(this, MainActivity.class);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
|
||||||
ComponentName launchComponent = null;
|
ComponentName launchComponent = null;
|
||||||
launchComponent = getApplication()
|
launchComponent = getApplication()
|
||||||
|
|||||||
Reference in New Issue
Block a user