我正在尝试使用以下工具创建样本玻璃应用程序 -
GDK预览API 19 Java 6 Android 4.4.2
我添加了以下活动 -
public class HelloWorldActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context con = this;
Card myCard = new Card(con);
myCard.setText("Hello, World!");
myCard.setFootnote("First Glassware for Glass");
View cardView = myCard.getView();
setContentView(cardView);
//setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
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.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
它给找不到Card类的错误,我添加了gdk.jar(21 KB),但仍然会抛出错误。请指教 我还检查了Card类代码及其存根类,但不包含实现。请问你能提供正确的gdk jar吗?