Here's the problem : There's a button in a view. When user click that button, insert a column to a table happened. I have read tutorial to connect mysql to android but I still can't solve this problem. And I have search in google but still can't find. I hope there's solution to finish my problem...
View MAIN
<ImageView
android:id="@+id/MAIN_tittle"
android:layout_width="300dp"
android:layout_height="115dp"
android:scaleX="1.2"
android:scaleY="1.2"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/main_tittle" />
<ImageButton
android:id="@+id/MAIN_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.7"
android:scaleY="0.7"
android:layout_below="@+id/MAIN_tittle"
android:layout_centerHorizontal="true"
android:background="@android:color/transparent"
android:src="@drawable/main_play" />
CLASS MAIN
public class MainMenu extends Activity {
ImageButton playButton = (ImageButton) findViewById(R.id.MAIN_play);
ImageButton optionsButton = (ImageButton) findViewById(R.id.MAIN_options);
ImageButton quitButton = (ImageButton) findViewById(R.id.MAIN_quit);
ImageButton facebookButton = (ImageButton) findViewById(R.id.MAIN_facebook);
ImageButton twitterButton = (ImageButton) findViewById(R.id.MAIN_twitter);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_menu);
//PROBLEM IN MANIFEST
play();
options();
quit();
goToFacebook();
rating();
}
private void play() {
playButton.setOnClickListener( new View.OnClickListener() {
public void onClick(View v)
{ startActivity(new Intent("com.example.creativesnakeladder.CharactersChoice"));
//this is area of codes which to insert a column in mysql database
}
});
}
Viewand theButtonjust showing aToastmessage when pressed. I get the impression you need to learn Android development in general, and not just the connection toward a database. Could be wrong though. :)