我想在Google地图中显示地址的位置.
如何使用Google Maps API获取地址的纬度和经度?
当我单击"作为Android应用程序运行"选项时,它会显示以下错误:
[2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port.
[2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2010-08-16 16:56:35 - Emulator] please use -help for more information
Run Code Online (Sandbox Code Playgroud) 我们可以在android数据库中使用截断查询吗?否则我们可以使用我们的java代码执行截断操作吗?
我正在使用自定义通知...如何设置不显示通知?并列出这些通知?这是我的代码......
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "coming", Toast.LENGTH_LONG).show();
Bundle descBundle = intent.getExtras();
CharSequence desc = descBundle.getString("description");
int reminderId = descBundle.getInt("reminderId");
NotificationManager mNotificationManager;
mNotificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(context,
reminderId, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);
RemoteViews contentView = new RemoteViews(context.getPackageName(),
R.layout.main);
contentView.setImageViewResource(R.id.image, R.drawable.reminder_1);
contentView.setTextViewText(R.id.text, desc);
Notification notifyDetails = new Notification();
notifyDetails.icon = R.drawable.reminder_1;
notifyDetails.when = System.currentTimeMillis();
notifyDetails.tickerText = desc;
notifyDetails.iconLevel = 1;
notifyDetails.number = reminderId;
notifyDetails.contentView = contentView;
notifyDetails.contentIntent = contentIntent;
mNotificationManager.notify(0, notifyDetails);
}
Run Code Online (Sandbox Code Playgroud)
我正在使用此代码显示通知...但它只显示一个通知内容...但图标显示没有通知...
我创建了AlertDialog使用构建器.它显示我们何时调用该show()方法.我在该对话框中有取消按钮.我可以通过单击取消按钮取消该对话框.我的问题是,一旦我取消显示对话框,我就无法再次显示对话框.它会抛出一个例外:
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.view.ViewGroup.addViewInner(ViewGroup.java:1970)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.view.ViewGroup.addView(ViewGroup.java:1865)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.view.ViewGroup.addView(ViewGroup.java:1845)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at com.android.internal.app.AlertController.setupView(AlertController.java:364)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at com.android.internal.app.AlertController.installContent(AlertController.java:205)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.app.AlertDialog.onCreate(AlertDialog.java:251)
Run Code Online (Sandbox Code Playgroud) 我正在使用此代码显示警告对话框...当我点击确定按钮时,它应显示日期选择器..
protected Dialog onCreateDialog(int id) {
switch (id) {
case TIME_DIALOG_ID:
return new TimePickerDialog(ListReminderActivity.this,
mTimeSetListener, mHour, mMinute, false);
case DATE_DIALOG_ID:
return new DatePickerDialog(ListReminderActivity.this,
mDateSetListener, mYear, mMonth, mDay);
case DESCRIPTION_DIALOG_ID:
return new AlertDialog.Builder(ListReminderActivity.this).setTitle(
"Add Reminder").setView(description).setPositiveButton(
R.string.add_alert_ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
ListReminderActivity.this
.dismissDialog(DESCRIPTION_DIALOG_ID);
ListReminderActivity.this
.removeDialog(DESCRIPTION_DIALOG_ID);
ListReminderActivity.this
.showDialog(DATE_DIALOG_ID);
}
}).setNegativeButton(R.string.add_alert_cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
ListReminderActivity.this
.dismissDialog(DESCRIPTION_DIALOG_ID);
ListReminderActivity.this
.removeDialog(DESCRIPTION_DIALOG_ID);
}
}).create();
}
return null;
}
Run Code Online (Sandbox Code Playgroud)
但问题是..当我按下确定按钮时,我得到了例外
例外是......
09-09 10:30:48.941: ERROR/AndroidRuntime(1189): FATAL EXCEPTION: …Run Code Online (Sandbox Code Playgroud) 我想在GWT中为Button调用click事件函数...我尝试了这段代码,但它无法正常工作..
Button btnAddField = new Button();
btnAddField.setText("Add");
btnAddField.setWidth("225px");
btnAddField.addClickHandler(new btnAddFieldButtonClickListener());
private class btnAddFieldButtonClickListener implements ClickHandler{
public void onClick(ClickEvent event) {
Window.alert("Called Click Event");
}
}
Run Code Online (Sandbox Code Playgroud)
这个函数会在单击按钮时调用,但调用此函数时不会调用 btnAddField.click()
can we run our android application in all iphone devices?