i want privacy policy , disclaimer statement and a color picker as 1 time run activity when the app is installed . So how can i use persistent storage so that when we install and run the app for the first time privacy policy runs then clicking on button(next) goes to disclaimer activity then to color picker and finally to main activity. And when second time app is run it directly goes to main activity.
MAIN ACTIVITY:
public static final String PREFS_NAME = "MyPrefsFile"; // Name of prefs file; don't change this after it's saved something
//public static final String PREFS_NAME = "MyPrefsFile";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); // Get preferences file (0 = no option flags set)
boolean firstRun = settings.getBoolean("firstRun", false); // Is it first run? If not specified, use "true"
if (firstRun == false) {
Log.w("activity", "first time");
setContentView(R.layout.activity_gasfurnancediagnostics);
SharedPreferences.Editor editor = settings.edit(); // Open the editor for our settings
editor.putBoolean("firstRun", false); // It is no longer the first run
editor.apply(); // Save all changed settings
return;
} else {
Log.w("activity", "second time");
checkColor();
setContentView(R.layout.activity_theme);
return;
}
// setContentView(R.layout.activity_main);
//*** CHECKING COLOR IF IT WAS SET PREVIOUSLY ***/
}
public void checkColor()
{
// INITIALIZING THE SHARED PREFRENECES
SharedPreferences pref = getApplicationContext().getSharedPreferences("Colors", 0);
// CHECK IF WE HAVE COLOR_SET VALIRABLE IF NOT DEFAULT WILL BE 0
int color_set = pref.getInt("color_set", 0);
if(color_set==0){
Intent e = new Intent(getApplicationContext(), ThemeActivity.class);
startActivity(e);
return;
}
if(color_set==1)
{ // IF IT IS ALREADY SET IN THE PREVIOUS THAN THIS CAN BE USED FOR REDIRECTING TO OTHER CONTROLLER AND THE BELOW FUNCTIONS CAN BE USED IN THAT CONTROLLER FOR COLOR MODIFICATIUON
String color = pref.getString("color", null); // COLOR CODE
ActionBar mActionBar = getActionBar(); // GETTING ACTIONBAR
//final Button testbutn = (Button) findViewById(R.id.testbtn); // GETTING BUTTON
if (color.equals("red")) {
mActionBar.setBackgroundDrawable(new ColorDrawable(0xFFBA1E1E)); // CHANGES ACTION BAR COLOR
// testbutn.setBackgroundColor(0xFFFF6666);
// CHANGES BUTTON COLOR
} else if (color.equals("blue")) {
mActionBar.setBackgroundDrawable(new ColorDrawable(0xFF21a4dd)); // CHANGES ACTION BAR COLOR
// testbutn.setBackgroundColor(0xFFFF4B7E); // CHANGES BUTTON COLOR
}
else if (color.equals("yellow")) {
mActionBar.setBackgroundDrawable(new ColorDrawable(0xFFF6D72B)); // CHANGES ACTION BAR COLOR
// testbutn.setBackgroundColor(0xFFFF4B7E); // CHANGES BUTTON COLOR
}
mActionBar.setDisplayShowTitleEnabled(false); // THESE TWO STEPS ARE REQUIRED AFTER CHANGING THE ACTION BAR COLOR
mActionBar.setDisplayShowTitleEnabled(true); // THESE TWO STEPS ARE REQUIRED AFTER CHANGING THE ACTION BAR COLOR
}
GAS FURNANCE ACTIVITY
Button btnnext = (Button)findViewById(R.id.nextbtn);
btnnext.setOnClickListener((OnClickListener) this);
}
public void onClick(View v) {
// TODO Auto-generated method stub
//Toast.makeText(parent.getContext(), "Button Clicked"+ dataModel.getName(),Toast.LENGTH_LONG).show();
//Intent yes= new Intent(parent.getContext(), yes(dataModel.getName().class));
switch(v.getId())
{
case R.id.nextbtn:
Intent a = new Intent(getApplicationContext(), MainActivity.class);
startActivity(a);
break;
default:
}
}
package com.example.gasfurnancediagnostics;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class ThemeActivity extends Activity implements ColorPicker.OnColorChangedListener {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_theme);
Button blueBtn = (Button) findViewById(R.id.bluebtn);
blueBtn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
//***** PERSISTANCE STORAGE INITIALIZATION****/
SharedPreferences pref = getApplicationContext().getSharedPreferences("Colors", 0);
// **** PERSISTANCE STORAGE EDITOR *** /
SharedPreferences.Editor editor = pref.edit();
editor.putString("color", "blue");
//**** DEFINING THE VALUE THAT THE COLOR IS ALREADY SET SO THAT WE CAN OMIT THIS ACTIVITY ***/
editor.putInt("color_set", 1);
//*** COMMITING ALL THE DETAILS TO THE STORAGE...
//** NOTE WITHOUT THIS THE DATA WONT BE SAVED
editor.commit();
Intent e = new Intent(getApplicationContext(), MainActivity.class);
startActivity(e);
}
});
Button redBtn = (Button) findViewById(R.id.redbtn);
redBtn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
//***** PERSISTANCE STORAGE INITIALIZATION****/
SharedPreferences pref = getApplicationContext().getSharedPreferences("Colors", 0);
// **** PERSISTANCE STORAGE EDITOR *** /
SharedPreferences.Editor editor = pref.edit();
editor.putString("color", "red");
//**** DEFINING THE VALUE THAT THE COLOR IS ALREADY SET SO THAT WE CAN OMIT THIS ACTIVITY ***/
editor.putInt("color_set", 1);
//*** COMMITING ALL THE DETAILS TO THE STORAGE...
//** NOTE WITHOUT THIS THE DATA WONT BE SAVED
editor.commit();
Intent e = new Intent(getApplicationContext(), MainActivity.class);
startActivity(e);
}
});
Button yellowBtn = (Button) findViewById(R.id.yellowbtn);
yellowBtn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
//***** PERSISTANCE STORAGE INITIALIZATION****/
SharedPreferences pref = getApplicationContext().getSharedPreferences("Colors", 0);
// **** PERSISTANCE STORAGE EDITOR *** /
SharedPreferences.Editor editor = pref.edit();
editor.putString("color", "yellow");
//**** DEFINING THE VALUE THAT THE COLOR IS ALREADY SET SO THAT WE CAN OMIT THIS ACTIVITY ***/
editor.putInt("color_set", 1);
//*** COMMITING ALL THE DETAILS TO THE STORAGE...
//** NOTE WITHOUT THIS THE DATA WONT BE SAVED
editor.commit();
Intent e = new Intent(getApplicationContext(), MainActivity.class);
startActivity(e);
}
});
}
#Override
public void colorChanged(String key, int color) {
// TODO Auto-generated method stub
}
}
SharedPreferences is what you are looking for,add this piece of code in your very first activity
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
Boolean firstRun = preferences.getString("FirstRun",true);
if(true)
{
/*Open your activity here which you want to open for only once*/
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("FirstRun",false);
editor.apply();
}
else
{
/*Open your activity which you want to open later,generally*/
}
See this for detailed explaination and this
Related
this is the class from where I want to call other class using button. The bTicketRes button and bAddBusData works fine but the 3rd button i.e bEditSms when clicked, the app cashes.
#Override
public void onClick(View view) {
// TODO Auto-generated method stub
switch(view.getId())
{
case R.id.bTicketRes:
TicketReservationView.setDatabase(database);
Intent it = new Intent(MainView.this,TicketReservationView.class);
startActivity(it);
break;
case R.id.bAddBusData:
BusDataManager.setDatabase(database);
Intent ib = new Intent(MainView.this, BusDataManager.class);
startActivity(ib);
break;
case R.id.bEditSms:
CustomSms.setDatabase(database);
Intent is = new Intent(MainView.this,CustomSms.class);
startActivity(is);
break;
and this is the class which i want to call using button in above class
public class CustomSms extends Activity implements OnClickListener {
private static Database database;
private Button bSaveSms,bBack1;
private EditText customSms,timeDelay;
private SQLiteDatabase db;
public String savSms, timeDly;
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.edit_sms);
customSms = (EditText)findViewById(R.id.etcustomSms);
timeDelay = (EditText)findViewById(R.id.ettimeDelay);
bSaveSms = (Button)findViewById(R.id.bSaveSms);
bBack1 = (Button)findViewById(R.id.bBack1);
bSaveSms.setOnClickListener(this);
bBack1.setOnClickListener(this);
}
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId())
{
case R.id.bSaveSms:
db = database.getWritableDatabase();
database.deleteOld(db, savSms, timeDly);
savSms = customSms.getText().toString();
timeDly= timeDelay.getText().toString();
database.insert_message_data(savSms, timeDly, db);
showToast("Message Saved Successfully");
//Toast.makeText(v.getContext(), "Data Saved Successfully", Toast.LENGTH_SHORT).show();
db.close();
break;
case R.id.bBack1:
customSms.setText("");
timeDelay.setText("");
Intent is = new Intent(CustomSms.this, MainView.class);
startActivity(is);
break;
}
}
public static void setDatabase(Database dbase) {
// TODO Auto-generated method stub
database = dbase;
}
public void showToast(final String title)
{
final View view = getLayoutInflater().inflate(R.layout.toast_layout, null);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
TextView tv = (TextView)view.findViewById(R.id.toastTitle);
final AlertDialog ad = alertDialogBuilder.create();
ad.setTitle("Notification");
ad.setView(view);
tv.setText(title);
ad.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
ad.dismiss();
}
});
ad.show();
}
when I click button in above class to call the below class, suddenly app crashes and the above class is restarted. I want that below class should be called upon pressing button in above class
I'm trying to change images when an image button is clicked. Even without the code for changing image my application is crashing whenever I use an onClickListener or try to set an onClick listener. How do i fix this I'm running app on kitkat api 19
package com.example.t11;
import android.R.string;
import android.support.v7.app.ActionBarActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ImageView;
public class Scene extends ActionBarActivity {
ImageView scene=(ImageView) findViewById(R.id.images);
int i=0;
int[] imgarray = {R.drawable.i1,R.drawable.i2,R.drawable.i4,R.drawable.i6,R.drawable.i7,R.drawable.i8,R.drawable.i9,R.drawable.i10,R.drawable.i12};
//Just set one Click listener for the image
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scene);
Intent sceneint = getIntent();
ImageButton left = (ImageButton) findViewById(R.id.left);
ImageButton right= (ImageButton) findViewById(R.id.right);
// Left and right button listener creation
left.setOnClickListener(leftlistener);
right.setOnClickListener(rightlistener);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.scene, menu);
return true;
}
View.OnClickListener rightlistener = new OnClickListener() {
public void onClick(View v1) {
//Increase Counter to move to next Image
i++;
scene.setImageResource(imgarray[i]);
}
};
View.OnClickListener leftlistener = new OnClickListener() {
public void onClick(View v) {
//Increase Counter to move to Previous Image
i--;
scene.setImageResource(imgarray[i]);
}
};
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Instantiate the listener as an anonymous function :
left.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
//Increase Counter to move to Previous Image
i--;
scene.setImageResource(imgarray[i]);
}
});
if you want the reference of the listener as well for some reason then try instantiating and assigning the listener before registering it with the button.
My Android application is mainly a Webview (labeles WebViewActivity) that navigates a mobile website. I have a connection detector that opens another activity on every URL load if there is no wireless connection. From this next activity there is a button that opens up the Wireless Settings. Upon pressing the back button I would like for the second activity (labeled MainActivity) to refresh itself and continue back to whichever page my Webview had loaded. What do I need to change in the MainActivity.java to execute that?
My MainActivity:
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends Activity {
// flag for Internet connection status
Boolean isInternetPresent = false;
// Connection detector class
ConnectionDetector cd;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
}
#Override
protected void onRestart(){
if(checkConnection()){
Intent intent= new Intent(this, WebViewActivity.class);
startActivity(intent);
}
}
#Override
// Detect when the back button is pressed
public void onBackPressed() {
super.onBackPressed();
}
public void openSettings(View view){
Intent intent= new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS);
startActivity(intent);
}
public boolean checkConnection(){
// creating connection detector class instance
cd = new ConnectionDetector(getApplicationContext());
//Get Internet Status
isInternetPresent = cd.isConnectingToInternet();
if(!isInternetPresent)
return false;
return true;
}
}
My WebviewActivity:
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class WebViewActivity extends Activity {
private WebView mWebView;
// flag for Internet connection status
Boolean isInternetPresent = false;
// Connection detector class
ConnectionDetector cd;
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// TODO Auto-generated method stub
if (checkConnection()) {
mWebView = (WebView) findViewById(R.id.activity_main_webview);
// Enable Javascript
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
mWebView.loadUrl("http://my.fellowshipnwa.org/?publicapp");
// Force links and redirects to open in the WebView instead of in a browser
mWebView.setWebViewClient(new myWebClient());
} else {
openSplash();
}
}
#Override
// Detect when the back button is pressed
public void onBackPressed() {
if(mWebView.canGoBack()) {
mWebView.goBack();
} else {
// Let the system handle the back button
new AlertDialog.Builder(this)
.setTitle("Exit myFellowship App?")
.setMessage("Are you sure you want to exit?")
.setNegativeButton(android.R.string.no, null)
.setPositiveButton(android.R.string.yes, new OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
WebViewActivity.super.onBackPressed();
}
}).create().show();
}
}
public class myWebClient extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(!checkConnection()){
openSplash();
return true;
}else{
if( url.startsWith("tel:")){
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity(intent);
return true;
}
else if( url.startsWith("mailto:")){
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(url));
startActivity(intent);
return true;
}
}
return false;
}
}
public void openSplash(){
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
public boolean checkConnection(){
// creating connection detector class instance
cd = new ConnectionDetector(getApplicationContext());
//Get Internet Status
isInternetPresent = cd.isConnectingToInternet();
if(!isInternetPresent)
return false;
return true;
}
}
Any help is Greatly Appreciated! Even if it means telling me I goofed up on creating this question.
Thank you friends.
I played with it for a while and used a few other examples to piece together something that is working. One small hitch is if the user turns on a connection, but it is not quite connected when they return to the app it will stay on the ConnectorActivity. So I intercept the back button to check for a connection. If present, it will finish the current activity. Then, upon returning to the webview it will reload.
ConnectorActivity.java:
#Override
protected void onRestart(){
super.onRestart();
if(checkConnection()){
finish();
}
}
#Override
// Detect when the back button is pressed
public void onBackPressed() {
if(checkConnection()){
super.onBackPressed();
}
}
Piece from WebViewActivity.java:
#Override
protected void onRestart(){
super.onRestart();
mWebView.reload();
}
I want write test case for ExpandableListView child view.
I have a 5 group of Expandable list view. Every group has individual child layout. So every time it would be child count is 1.
I want settext of AutoCompleteTextView for mAcTxtCarName using
TouchUtils.tapView(this, mAcTxtCarName);
sendKeys(KeyEvent.KEYCODE_H, KeyEvent.KEYCODE_U);
But i could not sendkeys like this.
This is code which i am using.
In this code, at assertSame(view, expandedView); not found same.
public void testStartCheckListActivity() throws Exception {
// add monitor to check for the second activity
final ActivityMonitor monitor = getInstrumentation().addMonitor(
CheckListActivity.class.getName(), null, false);
// find button and click it
final Button btnNewCalibration = (Button) mMenuActivity
.findViewById(R.id.btn_new_calibration);
// TouchUtils handles the sync with the main thread internally
TouchUtils.clickView(this, btnNewCalibration);
// wait 2 seconds for the start of the activity
final CheckListActivity checkListActivity = (CheckListActivity) monitor
.waitForActivityWithTimeout(2000);
assertNotNull(checkListActivity);
/** **New Calibration** */
// add monitor to check for the second activity
final ActivityMonitor monitorNewCalibration = getInstrumentation().addMonitor(
NewCalibrationActivity.class.getName(), null, false);
// find button and click it
final Button btnCheckListNext = (Button) checkListActivity
.findViewById(R.id.btn_footer_done);
TouchUtils.clickView(this, btnCheckListNext);
// wait 2 seconds for the start of the activity
final NewCalibrationActivity newCalibrationActivity = (NewCalibrationActivity) monitorNewCalibration
.waitForActivityWithTimeout(2000);
assertNotNull(newCalibrationActivity);
/** we get list view */
final ExpandableListView expandableListView = (ExpandableListView) newCalibrationActivity
.findViewById(R.id.explist_newcalibration);
newCalibrationActivity.runOnUiThread(new Runnable() {
#Override
public void run() {
expandableListView.requestFocus();
expandableListView.performItemClick(expandableListView, 2,
expandableListView.getItemIdAtPosition(2));
}
});
JunitUtils.waitTime(10);
// *******get last calibration or validation details for default
// display.**********
final PreferencesStorage preferncesStorage = new PreferencesStorage();
// New Calibration Details object from preference storage.
final NewCalibrationDetails calibrationDetails = preferncesStorage
.getNewCalibrationDetails(newCalibrationActivity);
final SQLAdapter adapter = new SQLAdapter(newCalibrationActivity);
adapter.open();
adapter.getLastCalibrationDetails(calibrationDetails);
adapter.close();
// **************************************************************************
if (expandableListView.isGroupExpanded(2)) {
Logger.d(tag, "$$$$$$$$$$$$$$$$$$$$$$$$$$$");
final LayoutInflater mLayoutInflater = (LayoutInflater) newCalibrationActivity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View view = mLayoutInflater.inflate(R.layout.items_newcalibration_child_3,
expandableListView, false);
// final View view = View.inflate(newCalibrationActivity,
// R.layout.items_newcalibration_child_3, null);
AutoCompleteTextView mAcTxtCarName = (AutoCompleteTextView) view
.findViewById(R.id.actxt_car_name);
AutoCompleteTextView mAcTxtModelNumber = (AutoCompleteTextView) view
.findViewById(R.id.actxt_model_number);
EditText mEdTxtLicencePlate1 = (EditText) view.findViewById(R.id.et_licence_plate_1);
EditText mEdTxtLicencePlate2 = (EditText) view.findViewById(R.id.et_licence_plate_2);
EditText mEdTxtLicencePlate3 = (EditText) view.findViewById(R.id.et_licence_plate_3);
AutoCompleteTextView mAcTxtOdometerValue = (AutoCompleteTextView) view
.findViewById(R.id.actxt_odometer_value);
AutoCompleteTextView mAcTxtReportingCode = (AutoCompleteTextView) view
.findViewById(R.id.actxt_reporting_code);
final NewCalibrationAdapter calibrationAdapter = new NewCalibrationAdapter(
newCalibrationActivity, calibrationDetails);
final View expandedView = calibrationAdapter.getChildView(2, 0, true, view,
expandableListView);
assertSame(view, expandedView);
mAcTxtCarName.requestFocus();
TouchUtils.tapView(this, mAcTxtCarName);
sendKeys(KeyEvent.KEYCODE_H, KeyEvent.KEYCODE_U);
getInstrumentation().waitForIdleSync();
}
else {
Logger.e(tag, "##############", null);
}
}
I have a question about an error I get in Eclipse.
Eclipse says "The nested type DisplayMessageActivity cannot hide an enclosing type"
This is my script:
package com.example.warzonegaming;
public class DisplayMessageActivity {
public class DisplayMessageActivity extends Activity {
#SuppressLint("NewApi")
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the message from the intent
Intent intent = getIntent();
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
// Create the text view
TextView textView = new TextView(this);
textView.setTextSize(40);
textView.setText(message);
// Set the text view as the activity layout
setContentView(textView);
// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// Show the Up button in the action bar.
getActionBar().setDisplayHomeAsUpEnabled(true);
}
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
}
}
Does someone knows an fix for this, because I can't go further now.
Regards
Try learn basics of javapackage com.example.warzonegaming;
public class DisplayMessageActivity extends Activity {
#SuppressLint("NewApi")
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the message from the intent
Intent intent = getIntent();
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
// Create the text view
TextView textView = new TextView(this);
textView.setTextSize(40);
textView.setText(message);
// Set the text view as the activity layout
setContentView(textView);
// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// Show the Up button in the action bar.
getActionBar().setDisplayHomeAsUpEnabled(true);
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
}