I am developing an app. Wish for it to scroll <ScrollView> code not working. Can anyone help me please?
I can upload my content_main.xml file.
I can upload my content_main.xml file.
android:layout_height="230dp" />
android:layout_height="230dp" >
public class MainActivity extends AppCompatActivity {
private Button mButton;
[USER=1021285]@override[/USER]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button activityButton = (Button) findViewById(R.id.button_quiz);
activity@Button.setOnClick(value = new OnClickListener(),
toolbar = (Toolbar) findViewById(R.id.toolbar), setSupportActionBar = (toolbar), mButton = (Button) findViewById(R.id.button_quiz), mButton =, setOnClickListener = (new OnClickListener() {
[USER=1021285]@override[/USER]
public void onClick(View view) {
//open url using Intent
String url = "http://www.cancunsteve.com/capecod/mobilepopquiz2.htm";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
}
}
activity@Button
the click listener is to know if the button is activated (clicked) this button loads the url in question
not sure why it calls a new click listener though
will follow your advice for posting code
bought an expensive book on android coding but it explains more to open new activity
if all else fails will go that route
public class MainActivity extends AppCompatActivity {
Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the view from activity_main.xml
setContentView(R.layout.activity_main);
// Locate the button in activity_main.xml
button = (Button) findViewById(R.id.MyButton);
// Capture button clicks
button.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// Start NewActivity.class
Intent myIntent = new Intent(MainActivity.this,
NewActivity2.class);
startActivity(myIntent);
}
});
}
Do you have NewActivity2 java class ?the errors are cannot find activity class NewActivity2. cannot find symbol variable activity_main
public class MainActivity extends AppCompatActivity {
Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the view from activity_main.xml
setContentView(R.layout.activity_main);
// Locate the button in activity_main.xml
button = (Button) findViewById(R.id.MyButton);
// Capture button clicks
button.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// Start NewActivity.class
Intent myIntent = new Intent(MainActivity.this,
NewActivity2.class);
startActivity(myIntent);
}
});
}
We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.