导航菜单

页面标题

页面副标题

BestFriend v2.0.20 - ReminderActivity.java 源代码

正在查看: BestFriend v2.0.20 应用的 ReminderActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.projectx.alarm;

import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.projectx.R;
import com.projectx.utils.ActivityUtils;

public class ReminderActivity extends AppCompatActivity {
    ReminderPresenter mReminderPresenter;
    Toolbar toolbar;

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_reminder_actvity);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        this.toolbar = toolbar;
        setSupportActionBar(toolbar);
        ActionBar supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.setDisplayHomeAsUpEnabled(true);
        }
        Intent intent = getIntent();
        if (!intent.hasExtra(ReminderFragment.EXTRA_ID)) {
            finish();
            return;
        }
        long longExtra = intent.getLongExtra(ReminderFragment.EXTRA_ID, 0L);
        if (((ReminderFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame)) == null) {
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(), ReminderFragment.newInstance(longExtra), R.id.contentFrame);
        }
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        ReminderPresenter reminderPresenter;
        if (menuItem.getItemId() == 16908332 && (reminderPresenter = this.mReminderPresenter) != null) {
            reminderPresenter.finishActivity();
        }
        return super.onOptionsItemSelected(menuItem);
    }

    public void onBackPressed() {
        ReminderPresenter reminderPresenter = this.mReminderPresenter;
        if (reminderPresenter != null) {
            reminderPresenter.finishActivity();
        }
    }
}