PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 0ms app.codeStats 1ms

/config/src/com/google/marvin/config/MainConfigActivity.java

http://eyes-free.googlecode.com/
Java | 42 lines | 25 code | 10 blank | 7 comment | 0 complexity | 36f4f12508a593ff400ef69f083916d4 MD5 | raw file
 1package com.google.marvin.config;
 2
 3import com.google.tts.R;
 4
 5import android.content.Intent;
 6import android.os.Bundle;
 7import android.preference.Preference;
 8import android.preference.PreferenceActivity;
 9import android.preference.Preference.OnPreferenceClickListener;
10
11/**
12 * Main configuration screen that displays a menu of installable apps
13 * and a checkbox option to use the Eyes-Free Shell as the default Home screen.
14 * 
15 * @author clchen@google.com (Charles L. Chen)
16 */
17public class MainConfigActivity extends PreferenceActivity  {
18
19  private MainConfigActivity self;
20
21
22  /** Called when the activity is first created. */
23  @Override
24  public void onCreate(Bundle savedInstanceState) {
25    super.onCreate(savedInstanceState);
26    self = this;
27    addPreferencesFromResource(R.xml.prefs);
28    Preference previewPref = findPreference("install");
29    previewPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
30      public boolean onPreferenceClick(Preference preference) {
31        Intent installerIntent = new Intent(self, InstallerActivity.class);
32        self.startActivity(installerIntent);
33        return true;
34      }
35    });
36    getPackageManager().addPackageToPreferred(this.getPackageName());
37  }
38
39
40
41
42}