Android Open Source - Android-SDK-Manager Activity Settings






From Project

Back to project page Android-SDK-Manager.

License

The source code is released under:

Apache License

If you think the Android project Android-SDK-Manager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.pk.androidsdk.activity;
/*from w  ww. j ava 2  s  .c  o  m*/
import android.app.ActionBar;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MenuItem;

import com.pk.androidsdk.R;

public class ActivitySettings extends Activity
{
  ActionBar actionBar;
  
  @Override
  protected void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);
    
    actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item)
  {
    switch (item.getItemId())
    {
      case android.R.id.home:
        Exit();
        return true;
      default:
        return super.onOptionsItemSelected(item);
    }
  }
  

  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event)
  {
    if (keyCode == KeyEvent.KEYCODE_BACK)
    {
      Exit();
      return true;
    }
    
    return super.onKeyDown(keyCode, event);
  }
  
  private void Exit()
  {
    finish();
    overridePendingTransition(R.anim.fslide_left_in, R.anim.fslide_right_out);
  }
}




Java Source Code List

com.pk.androidsdk.activity.ActivityDisplay.java
com.pk.androidsdk.activity.ActivityMain.java
com.pk.androidsdk.activity.ActivitySettings.java
com.pk.androidsdk.adapter.DrawerAdapter.java
com.pk.androidsdk.fragment.FragmentDisplay.java
com.pk.androidsdk.fragment.FragmentFetch.java
com.pk.androidsdk.model.FilterItem.java
com.pk.androidsdk.model.SDKArchive.java
com.pk.androidsdk.model.SDKPackage.java