0
我正在使用android sdk和eclipse进行Android项目工作。我有我的Java代码的问题,所以我想知道是否任何人谁知道Java可以帮助我与我的代码?使用android SDK和Eclipse进行Java编程
这是我的代码。这些是有问题的错误IM - >
public class MainActivity extends ActionBarActivity {
private static final String R = null;
int counter;
Button add, sub;
TextView display;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
error -> setContentView(R.layout.activity_main);
counter = 0;
error -> add = (Button) findViewById(R.id.button1);
error -> sub = (Button) findViewById(R.id.button2);
error -> display = (TextView) findViewById(R.id.text);
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
counter++;
display.setText("Your Total is" + counter);
}
});
sub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
counter--;
display.setText("Your total is " + counter);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
error -> getMenuInflater().inflate(R.menu.main, 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.`enter code here`
int id = item.getItemId();
error -> if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
请加上问题,你有什么样的问题。 – AtanuCSE