-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fragmentų gyvavimo ciklo loginimas Analogiškai kaip ir su Activity gyvavimo ciklo loginimu, pasidarome ir Fragment'ų gyvavimo ciklo loginimą. Apie [Android Fragment lifecycle galima pasiskaityti android.com svetainėje] (http://developer.android.com/guide/components/fragments.html) Taigi reikės susikurti `BaseFragment` pagrindinę klasę, kurioje sudėsime loginimo metodus: * onAttach
- Loading branch information
1 parent
8a58e20
commit c6e9e5c
Showing
3 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package lt.andro.maistobankas; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.support.v4.app.Fragment; | ||
import android.util.Log; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
/** | ||
* @author Vilius Kraujutis viliusk@gmail.com | ||
* @since 2014-02-08 13:04 | ||
*/ | ||
public class BaseFragment extends Fragment { | ||
@Override | ||
public void onAttach(Activity activity) { | ||
super.onAttach(activity); | ||
Log.d("MBBaseFragment", "onAttach"); | ||
} | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
Log.d("MBBaseFragment", "onCreate"); | ||
} | ||
|
||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | ||
Log.d("MBBaseFragment", "onCreateView"); | ||
return super.onCreateView(inflater, container, savedInstanceState); | ||
} | ||
|
||
@Override | ||
public void onActivityCreated(Bundle savedInstanceState) { | ||
super.onActivityCreated(savedInstanceState); | ||
Log.d("MBBaseFragment", "onActivityCreated"); | ||
} | ||
|
||
@Override | ||
public void onStart() { | ||
super.onStart(); | ||
Log.d("MBBaseFragment", "onStart"); | ||
} | ||
|
||
@Override | ||
public void onResume() { | ||
super.onResume(); | ||
Log.d("MBBaseFragment", "onResume"); | ||
} | ||
|
||
@Override | ||
public void onPause() { | ||
super.onPause(); | ||
Log.d("MBBaseFragment", "onPause"); | ||
} | ||
|
||
@Override | ||
public void onStop() { | ||
super.onStop(); | ||
Log.d("MBBaseFragment", "onStop"); | ||
} | ||
|
||
@Override | ||
public void onDestroyView() { | ||
super.onDestroyView(); | ||
Log.d("MBBaseFragment", "onDestroyView"); | ||
} | ||
|
||
@Override | ||
public void onDestroy() { | ||
super.onDestroy(); | ||
Log.d("MBBaseFragment", "onDestroy"); | ||
} | ||
|
||
@Override | ||
public void onDetach() { | ||
super.onDetach(); | ||
Log.d("MBBaseFragment", "onDetach"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters