Exemplo n.º 1
0
  private void callEmailActivity(SendMeData sendMeData) {
    final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

    String email = SettingActivity.getCurrentEmail(this);

    if (email == null || email.trim().length() <= 2) {
      Toast.makeText(this, "Please set your email address before sending", Toast.LENGTH_LONG)
          .show();
      return;
    }

    emailIntent.setType("plain/text");

    emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {email});

    emailIntent.putExtra(
        Intent.EXTRA_SUBJECT, SettingActivity.getSubjectResult(this, sendMeData.getSubject()));

    emailIntent.putExtra(Intent.EXTRA_TEXT, sendMeData.getBody());

    startActivity(emailIntent);
  }
Exemplo n.º 2
0
 @Override
 public void onClick(View v) {
   if (v == btnLeft) {
     getActivity().finish();
   } else if (v == btnMsgSwitch) { // 是否接受消息
     App.PREFS.setAcceptMsg(App.PREFS.isAcceptMsg() ? false : true);
     switchAcceptMsg();
   } else if (v == btnSoundSwitch) { // 声音提醒
     App.PREFS.setSoundOpen(App.PREFS.isSoundOpen() ? false : true);
     switchSound();
   } else if (v == btnShakeSwitch) { // 震动提醒
     App.PREFS.setShakeOpen(App.PREFS.isShakeOpen() ? false : true);
     switchShake();
   } else if (v == aboutContainer) { // 关于偶们
     host.switchFragment(host.FRAGMENT_ABOUT);
   }
 }
Exemplo n.º 3
0
  public void onUpdate(
      Context context, AppWidgetManager appWidgetManager, final int[] appWidgetIds) {
    int n = appWidgetIds.length;
    if (timers == null) timers = new HashMap<Integer, Timer>();
    for (int i = 0; i < n; i++) {
      int styleId = SettingActivity.getStyleId(context, appWidgetIds[i], R.id.radiobutton1);

      if (timers.get(appWidgetIds[i]) != null) {
        ((Timer) timers.get(appWidgetIds[i])).cancel();
      }
      Message message = new Message();
      message.arg1 = appWidgetIds[i];
      message.arg2 = styleId;
      updateView(context, appWidgetManager, message);
      startTimer(context, appWidgetManager, appWidgetIds[i], styleId);
    }
  }
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.scan_music_adddirectory);
		
		resultCode=ScanMusicActivity.SCAN_MUSIC_CANCEL;
		setBackButton();
		setTopTitle(getResources().getString(R.string.scan_directory_title));
		
		//检测SD卡
		if(!Common.isExistSdCard()){
			Toast.makeText(this, "请先插入SD卡", Toast.LENGTH_SHORT).show();
			setResult(RESULT_CANCELED);
			this.finish();
		}
		
		lv_scan_music_list=(ListView)this.findViewById(R.id.lv_scan_music_list);
		
		((Button)this.findViewById(R.id.btn_scan_add)).setOnClickListener(listener);
		((Button)this.findViewById(R.id.btn_scan_back)).setOnClickListener(listener);
		((Button)this.findViewById(R.id.btn_scan_directory_goup)).setOnClickListener(listener);

		//获取默认音乐目录的选取结果
		rs=getIntent().getStringExtra("rs");
		
		//读取mnt根目录
		myFilterFile=new ScanMusicFilterFile();
		lv_scan_music_list=(ListView)this.findViewById(R.id.lv_scan_music_list);
		currrentFile=Environment.getExternalStorageDirectory().getParentFile();//获取sd卡路径的父目录文件
		rootFilePath=currrentFile.getPath().toLowerCase();//设置根目录的路径
		data=new ArrayList<ScanData>();
		getFilePath(currrentFile);//遍历目录
		adapter=new ScanListAdapter(this,data);
		adapter.setCheckFilePath(rs);
		lv_scan_music_list.setAdapter(adapter);
		lv_scan_music_list.setOnItemClickListener(itemClickListener);
	}
Exemplo n.º 5
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   super.setContentView(R.layout.menu_about_layout);
   super.setTopTitle(getResources().getString(R.string.about_title));
 }