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