public class BaseActivity
Base class that implements some common methods
Modifier and Type | Field and Description |
---|---|
android.content.SharedPreferences |
sharedPreferences
The shared preferences used for storing stuff like API keys
|
Constructor and Description |
---|
BaseActivity()
Base class that implements some common methods
|
Modifier and Type | Method and Description |
---|---|
android.content.SharedPreferences |
getSharedPreferences()
The shared preferences used for storing stuff like API keys
|
void |
onCreate(android.os.Bundle savedInstanceState)
Initializes the Shared preferences
|
void |
setSharedPreferences(android.content.SharedPreferences p)
The shared preferences used for storing stuff like API keys
|
void |
showErrorDialog(int titleResource,
int bodyResource)
Shows an error dialog.
|
void |
startActivity(java.lang.Class<?> target,
boolean finish,
android.os.Bundle bundle)
Starts a new activity
|
void |
startLoadingAnimation()
Starts the loading animation
|
void |
stopLoadingAnimation()
Stops the loading animation
|
public android.content.SharedPreferences sharedPreferences
The shared preferences used for storing stuff like API keys
public BaseActivity()
Base class that implements some common methods
public android.content.SharedPreferences getSharedPreferences()
The shared preferences used for storing stuff like API keys
public void setSharedPreferences(android.content.SharedPreferences p)
The shared preferences used for storing stuff like API keys
public void onCreate(android.os.Bundle savedInstanceState)
Initializes the Shared preferences
savedInstanceState
- : The bundle provided by a previous activitypublic void showErrorDialog(int titleResource, int bodyResource)
Shows an error dialog.
titleResource
- : The resource of the error message titlebodyResource
- : The resource of the error message bodypublic void startActivity(java.lang.Class<?> target, boolean finish, android.os.Bundle bundle)
Starts a new activity
target
- : The activity to startfinish
- : Specifies whether or not the activity will be finishedbundle
- : Optional bundle object to pass on to the new activitypublic void startLoadingAnimation()
Starts the loading animation
public void stopLoadingAnimation()
Stops the loading animation