package com.netfluke.sergey.greeter; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity { public int REQ_CODE = 1001; private boolean pressed; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) Log.d("BUNDLE onStart", "got NULL"); else Log.d("BUNDLE onStart", savedInstanceState.toString()); // This function runs when it gets the android.intent.action.MAIN from // Android's Launcher app (with the category android.intent.category.LAUNCHER; // see MainActivity's intent-filter element in the AndroidManifest. // So we can print that Intent to the log, to see what it looks like; // Android core classes typically have a useful toString() method on them. Intent init_intent = getIntent(); Log.d("INTENT in onCreate", init_intent.toString()); // Otherwise, this code serves no purpose, but it could call different handler functions // depending on the TYPE of the Intent passed. See // https://developer.android.com/training/sharing/index.html // and https://developer.android.com/training/sharing/receive.html // Connect button 2 if it's not connected via XML attribute // android:onClick="onButtonClick" // in the