当按钮调用onClick活动停止时

时间:2015-03-07 14:02:57

标签: java android onclick

所以我有这个重置按钮,调用onclick ResetButtonClicked这里是代码

public void ResetButtonClicked(View view){
   SharedPreferences sharedPref= getSharedPreferences("userInfo", Context.MODE_PRIVATE);
    SharedPreferences.Editor editor=sharedPref.edit();
    editor.putString("phone1",sa.toString());
    editor.putString("phone2",re.toString());
    mActivity.stud();
    Toast.makeText(this, "All Emergency Numbers have been Reset.", Toast.LENGTH_SHORT).show();

}

BTW:mActivity.stud是来自main activity.it的函数,之前已在下面给出的创建代码中声明了

 MainActivity mActivity= new MainActivity();

0 个答案:

没有答案