I created a project in Android Studio (yes, the Rotate the device). I finished the main screen and created the action for the Root button. After I created a "Welcome" screen, several errors appeared. One of these are these;
Error: (23, 10) error: ')' expected
Error: (27, 39) error: ';' expected
Error: (27, 49) error: ';' expected
Error: (34, 41) error: ';' expected
Error: (34, 55) error: ';' expected
Error: (47, 2) Error: reached end of file while parsing
Error: Execution failed for task ': app: compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
This is the Welcome Screen MainActivity:
package com.hyanhythalo.rootfox;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
public class Main2Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
final Button button = (Button) findViewById(R.id.welcome_ok_button);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main2, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}