I'm new so excuse me if being not good with my question at first place :D here is my code which works great :
package com.github.chenxiaolong.dualbootpatcher;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
public class Patch extends Activity{
MediaPlayer mpbuttonclick;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(R.layout.patcher);
mpbuttonclick = MediaPlayer.create(this, R.raw.keypress);
Button sumbitButton = (Button) findViewById(R.id.submitbutton);
sumbitButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v){
EditText passwordEditText = (EditText) findViewById(R.id.passwordedittext);
if(passwordEditText.getText().toString().equals("1234")){
startActivity(new Intent(".MainActivity"));
mpbuttonclick.start();
}}});
}}
and here is my AndroidManifest :
<activity
android:name=".MainActivity"
android:label="@string/app_name_release"
android:theme="@style/DrawerActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Patch"
android:label="@string/app_name_release"
android:theme="@style/DrawerActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
it compiles well but when i input 1234 to text it force closes the app here is logcats logs can you correct my code and explain me ? i want to learn too :P thanks in advance