当我点击片段中的linearlayout时,它不会给出任何错误,但不会启动新的活动.我的代码中有错误吗?请有人帮助我.这个片段是我项目的xml文件代码.
Fragment_one.xml
<?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"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<LinearLayout
android:id="@+id/Lbid"
android:layout_width="wrap_content"
android:layout_marginTop="30dp"
android:layout_height="wrap_content">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:id="@+id/pbb"
android:layout_marginLeft="15dp"
android:layout_width="180dp"
android:layout_height="25dp"
android:progress="50"
android:progressDrawable="@drawable/bidonpb"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bid on"
android:id="@+id/tv"
android:layout_marginLeft="2dp"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/Lap"
android:layout_width="wrap_content"
android:layout_marginTop="20dp"
android:layout_height="wrap_content">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:id="@+id/pbap"
android:layout_marginLeft="15dp"
android:layout_width="180dp"
android:layout_height="25dp"
android:progress="60"
android:progressDrawable="@drawable/appb"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Awaiting Payments"
android:layout_marginLeft="2dp"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/LO"
android:layout_width="wrap_content"
android:layout_marginTop="20dp"
android:layout_height="wrap_content">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:id="@+id/pbo"
android:layout_marginLeft="15dp"
android:layout_width="180dp"
android:layout_height="25dp"
android:progress="20"
android:progressDrawable="@drawable/opb"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Overdue" …Run Code Online (Sandbox Code Playgroud) 这是我的ArrayAdapter代码.当我点击LinearLayout"cat"时,它会在dialog.show()上给出错误.我不知道如何在ArrayAdapter类中创建自定义对话框.当我删除创建对话框部分时,一切正常.
提前致谢
CategoryAdapter.java
public class CategoryAdapter extends ArrayAdapter<String> {
private final Context context;
String[] menu = new String[25] ;
String[] menu2 = new String[25];
String[] menu3 = new String[25];
private LayoutInflater inflater;
viewholder vh;
public CategoryAdapter(Context context, String [] menu,String [] menu2,String [] menu3) {
super(context, R.layout.categoryadapter, menu);
this.context = context;
this.menu = menu;
this.menu2=menu2;
this.menu3=menu3;
}
public View getView(final int position, View convertView, ViewGroup parent) {
{
vh=new viewholder();
if (inflater == null)
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = …Run Code Online (Sandbox Code Playgroud)