【发布时间】:2015-05-17 10:03:00
【问题描述】:
我有一个显示Dialog 的adroid 应用程序,当您点击listview 中的相应项目时会显示一些数据并且工作正常,但是当我第二次点击另一个项目时,它会崩溃。
列表视图调用一个 xml,在里面我调用一个地图片段,该地图片段使其崩溃,出于某种原因。
这是itemlistdialog
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:layout_width="match_parent"
android:layout_height="285dp"
android:name="com.google.android.gms.maps.MapFragment"
android:id="@+id/map" />
</LinearLayout>
这里我每次点击列表时都会调用打开对话框。
lista.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
LayoutInflater factory = LayoutInflater.from(this);
View listDialogView = factory.inflate(R.layout.itemlistdialog, null);
Dialog d = new AlertDialog.Builder(aux,AlertDialog.THEME_HOLO_LIGHT)
//HERE I ADD THE DATA THAT WILL BE DISPLAYED IN THE DIALOG
}
编辑: 这是完整的错误。 错误太大,无法在此处添加 http://prntscr.com/6gyng6
【问题讨论】:
-
发布(添加到问题中)您的 Logcat。
-
对不起,我不明白。
-
我们要求您发布应用程序崩溃时出现的 logcat 窗口中的错误
-
由于某种原因我的电脑无法运行任何模拟器,所以我使用设备来测试应用程序。
标签: java android xml android-fragments