• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps no operation is performing when clicking on savedata button

this is my SaveData.java
when i was clicking on savedata button it is not saving the image(i have selected the desired image) and its not doing anything i have saved some images in sdcard while retrying the images it works fine

public class SaveData extends Activity implements OnClickListener {
private DataManipulator dh;
static final int DIALOG_ID = 0;

@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.addname);
View button1Click=findViewById(R.id.btn_choose);
button1Click.setOnClickListener(this);
View add = findViewById(R.id.Button01add);
add.setOnClickListener(this);
View home = findViewById(R.id.Button01home);
home.setOnClickListener(this);
}

public void onClick(View v){

switch(v.getId()){
case R.id.btn_choose:
Intent i=new Intent(this, BrowsePicture.class);
startActivity(i);
break;

case R.id.Button01add:
View editText1 = (EditText) findViewById(R.id.name);
String myEditText1=((TextView) editText1).getText().toString();
Intent i1 = new Intent(this, SaveData.class);
startActivity(i1);
this.dh = new DataManipulator(this);
this.dh.insert(myEditText1);

showDialog(DIALOG_ID);
break;

case R.id.Button01home:
Intent i2 = new Intent(this, CheckData.class);
startActivity(i2);
break;

}
}
protected final Dialog onCreateDialog(final int id) {
Dialog dialog = null;
switch(id) {
case DIALOG_ID:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Information saved successfully ! Add Another Info?")
.setCancelable(false)
.setPositiveButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {

SaveData.this.finish();

}
})
.setNegativeButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
dialog = alert;
break;

default:

}
return dialog;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.layout.mymenu, menu);

return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == R.id.item1) {
Log.d("Option", "Save option is clicked");
}
if(item.getItemId() == R.id.item2) {
Log.d("Option", "Delete option is clicked");
}
if(item.getItemId() == R.id.item3) {
Log.d("Option", "Exit option is clicked");
}
return super.onOptionsItemSelected(item);
}
}
 
Back
Top Bottom