this page doesn't show anything any errors, it is a button that is linked to another page "arabianangelfish.xml", in the past, it was like this:
package com.d.di;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
public class PageFish extends Activity {
Button fishlink;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fish);
}
}
After that, some people said that it needs a click listener to a button, but it didn't work
package com.d.di;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class PageFish extends Activity {
Button fishlink;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fish);
fishlink = (Button) findViewById(R.id.arabianangelfish);
fishlink.setOnClickListener(new OnClickListener() {
public void OnClick(View v) {
Intent intent = new Intent(PageFish.this,
PageArabianangelfishies.class);
startActivity(intent);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
}
}
No comments:
Post a Comment