我在 Google Play (Punny Jokes) 上有这个笑话应用程序,要获得笑话,用户必须点击屏幕上的任意位置,然后在笑话屏幕上,他们才能阅读笑话。但是当他们想要另一个笑话时,他们必须回到主屏幕并再次按下屏幕,这往往很烦人。我正在尝试在笑话屏幕活动上设置另一个全屏按钮,因此他们不必返回。笑话在字符串中,我有在名为“StartingPoint”的类中选择随机随机字符串的代码。非常感谢!
public class DisplayMessageActivity extends Activity implements OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_message);
**//ERROR BEGINS HERE**
Button next;
Button next = (Button) = findViewById (R.id.next);
next.setOnClickListener(this);
**//ERROR ENDS HERE**
initTypeface1();
}
@Override
public void onClick(final View v) {
switch(v.getId()){
case R.id.next:
IntentHandler.switchActivity(DisplayMessageActivity.this,
StartingPoint.class, false);
break;
// TODO Auto-generated method stub
}
}
};