package com.github.shiraji.sample_java;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

@@ -34,16 +34,42 @@
 _java;%0A%0A
+import android.os.Bundle;%0A
 import a
@@ -124,25 +124,24 @@
 android.
-os.Bundle
+util.Log
 ;%0A%0Apubli
@@ -305,16 +305,16 @@
 State);%0A
-
         
@@ -358,11 +358,592 @@
 );%0A    %7D
+%0A%0A    @Override%0A    protected void onStart() %7B%0A        super.onStart();%0A        if (((MyApp) getApplication()).isForeground()) Log.d(%22MainAktivity%22, %22App is foreground%22);%0A        if (((MyApp) getApplication()).isReturnedFromBackground()) Log.d(%22MainAktivity%22, %22App returns from background%22);%0A    %7D%0A%0A    @Override%0A    protected void onStop() %7B%0A        super.onStop();%0A        if (((MyApp) getApplication()).isForeground()) Log.d(%22MainAktivity%22, %22App is still foreground%22);%0A        if (((MyApp) getApplication()).isBackground()) Log.d(%22MainAktivity%22, %22App goes to background%22);%0A    %7D
 %0A%7D%0A

Update Java sample