我有一项主要活动,例如
public class mainActivity extends sampleActivity
现在使用 sampleActivity 获取相机我想在捕获 5 张照片并显示消息时停止相机。我设置了条件和消息,但我无法在 mainActivity 中仅停止sampleActivity的解决方案。
public class mainActivity extends sampleActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
private void count()
{
try
{
count=0;
String str="SELECT count(*) as count FROM test";
mCursor=mDatabase.getReadableDatabase().rawQuery(str,null);
mCursor.moveToFirst();
count=mCursor.getInt(mCursor.getColumnIndex("count"));
if(count>=3){
//sampleActivity.finish(); here i want to finish sampleactivity
Toast.makeText(sampleActivity .this,"close!", Toast.LENGTH_LONG).show();
}
}
catch(Exception e)
{
e.printStackTrace();
}
}