最好的启动方式

package com.example.zhuopeng.demo2;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MenuItem;
import android.widget.TextView;

public class SecondActivity extends BaseActivity {
    private static final String TAG = "SecondActivity";
    public static void actionStart(Context context, String data1, String data2){
        Intent intent = new Intent(context,SecondActivity.class);
        intent.putExtra("param1",data1);
        intent.putExtra("param2",data2);
        context.startActivity(intent);
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        Log.d(TAG, getIntent().getStringExtra("param1 ")+getIntent().getStringExtra("param2"));
    }


}

 

posted @ 2018-01-29 14:22  式微胡不归  阅读(121)  评论(0编辑  收藏  举报