Exemplo n.º 1
1
 // 菜单响应
 public boolean onOptionsItemSelected(MenuItem item) {
   super.onOptionsItemSelected(item);
   switch (item.getItemId()) {
     case 0:
       ActivityManager.getInstance().exit();
   }
   return true;
 }
Exemplo n.º 2
0
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.menu_website:
       Uri uri = Uri.parse("http://moeapk.com/apk/" + app_package + ".html");
       Intent intent = new Intent(Intent.ACTION_VIEW, uri);
       startActivity(intent);
       break;
     case R.id.menu_clear_cache:
       memoryCache.clear();
       fileUtils.clearCache();
       Toast.makeText(
               getApplicationContext(), R.string.toast_clear_cache_finish, Toast.LENGTH_LONG)
           .show();
       break;
     case R.id.menu_about:
       Intent myintent = new Intent();
       myintent.setClass(ApkListActivity.this, AboutActivity.class);
       startActivity(myintent);
       break;
     case R.id.menu_exit:
       ActivityManager.getInstance().exit();
       break;
   }
   return true;
 }
Exemplo n.º 3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_index);

    localinfo = new LocalInfo(this);

    // 活动管理器
    ActivityManager.getInstance().addActivity(IndexActivity.this);

    // 绑定列表样式
    index_listview = (ListView) findViewById(R.id.index_list);

    // 设定点击监听器
    index_listview.setOnItemClickListener(this);

    MoeApkSetEditor = this.getSharedPreferences(MoeApk_PREF_NAME, 2).edit();
    MoeApkSetReader = this.getSharedPreferences(MoeApk_PREF_NAME, 1);

    // 获取分类
    list_item = moeapk.App_Type;

    // 制造列表
    ThreadGetList();
    FirstStart();
    // 向API服务器报告一次运行了这个客户端
    moeapk.registerClient(DeviceId);
  }
Exemplo n.º 4
0
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
     if ((System.currentTimeMillis() - exitTime) > 2000) {
       Toast.makeText(getApplicationContext(), "再按一次退出程序", Toast.LENGTH_LONG).show();
       exitTime = System.currentTimeMillis();
     } else {
       ActivityManager.getInstance().exit();
     }
     return true;
   }
   return super.onKeyDown(keyCode, event);
 }
Exemplo n.º 5
0
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_applist);

    // 活动管理器
    ActivityManager.getInstance().addActivity(ApkListActivity.this);

    setTitle(getResources().getString(R.string.title_choose_version));
    Log.i("DEBUG", "进入APK库");
    intent = getIntent();
    listview = (ListView) findViewById(R.id.AppListView);
    listview.setOnItemClickListener(this);
    app_package = intent.getStringExtra("app_package");
    ThreadGetList();
  }
Exemplo n.º 6
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.activity_register);

    // 退出时清除所有Activity
    ActivityManager.getInstance().addActivity(this);

    register_name = (EditText) findViewById(R.id.register_name);
    register_password = (EditText) findViewById(R.id.register_password);
    register_password_confirm = (EditText) findViewById(R.id.register_password_confirm);
    register_telephone = (EditText) findViewById(R.id.register_telephone);
    radioSex = (RadioGroup) findViewById(R.id.radio_sex);
    radio_male = (RadioButton) findViewById(R.id.radioButton_male);
    radio_female = (RadioButton) findViewById(R.id.radioButton_female);

    mRegisterFormView = findViewById(R.id.Register_ScrollView);
    mRegisterStatusView = findViewById(R.id.register_status);

    findViewById(R.id.register_confirm)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                attemptRegister();
              }
            });
    findViewById(R.id.register_cancel)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
                startActivity(intent);
                RegisterActivity.this.finish();
              }
            });
    register_name.requestFocus();
  }