久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='stAGb'></bdo><ul id='stAGb'></ul>
    <i id='stAGb'><tr id='stAGb'><dt id='stAGb'><q id='stAGb'><span id='stAGb'><b id='stAGb'><form id='stAGb'><ins id='stAGb'></ins><ul id='stAGb'></ul><sub id='stAGb'></sub></form><legend id='stAGb'></legend><bdo id='stAGb'><pre id='stAGb'><center id='stAGb'></center></pre></bdo></b><th id='stAGb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='stAGb'><tfoot id='stAGb'></tfoot><dl id='stAGb'><fieldset id='stAGb'></fieldset></dl></div>

    <small id='stAGb'></small><noframes id='stAGb'>

  1. <tfoot id='stAGb'></tfoot>

    <legend id='stAGb'><style id='stAGb'><dir id='stAGb'><q id='stAGb'></q></dir></style></legend>

    1. 對(duì)話框中的自定義 ListView

      Custom ListView in a dialog(對(duì)話框中的自定義 ListView)

      <small id='bcxm6'></small><noframes id='bcxm6'>

          <tbody id='bcxm6'></tbody>
        <legend id='bcxm6'><style id='bcxm6'><dir id='bcxm6'><q id='bcxm6'></q></dir></style></legend>
          <bdo id='bcxm6'></bdo><ul id='bcxm6'></ul>
        • <i id='bcxm6'><tr id='bcxm6'><dt id='bcxm6'><q id='bcxm6'><span id='bcxm6'><b id='bcxm6'><form id='bcxm6'><ins id='bcxm6'></ins><ul id='bcxm6'></ul><sub id='bcxm6'></sub></form><legend id='bcxm6'></legend><bdo id='bcxm6'><pre id='bcxm6'><center id='bcxm6'></center></pre></bdo></b><th id='bcxm6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bcxm6'><tfoot id='bcxm6'></tfoot><dl id='bcxm6'><fieldset id='bcxm6'></fieldset></dl></div>

            1. <tfoot id='bcxm6'></tfoot>
              1. 本文介紹了對(duì)話框中的自定義 ListView的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問題描述

                我有一個(gè)列表視圖,在這個(gè)列表中,當(dāng)點(diǎn)擊其中的一個(gè)項(xiàng)目時(shí),它會(huì)在對(duì)話框中顯示一個(gè)自定義列表

                i have a list view , inside this list when click on an item of it ,it will show a custom list inside a dialog box

                對(duì)話框顯示,但它只顯示對(duì)話框的標(biāo)題

                the dialog shows up but its only shows the title of the dialog

                這是我的代碼

                            case R.id.CommentNumOfLike:
                
                            dbobj = new DataBaseHandler(getContext());
                            Items1 = dbobj.select_HowComment();
                            dbobj.CloseDataBase();
                            Collections.reverse(Items1);
                            x = (Integer) view.getTag();
                            Log.v("value", x + "");
                            target = Items1.get(x).getCommentId().toString();
                            CommentEvents r = new CommentEvents();
                            r.execute(user_id, secret_id, table, target);
                
                                            final Dialog dialog = new Dialog(getContext());
                            dialog.setContentView(R.layout.likers_list);
                            dialog.setTitle("List of likers");
                            dialog.setCanceledOnTouchOutside(true);
                            dbobj = new DataBaseHandler(getContext());
                            likeItems=dbobj.select_HowlikeComment();
                            dbobj.CloseDataBase();
                
                            ListView list = (ListView) dialog.findViewById(R.id.ListLikersList);
                            LikersCustomeAdapter adapter= new LikersCustomeAdapter(getContext(), R.layout.likerscustomelist, likeItems);
                
                            list.setAdapter(adapter);
                
                            dialog.show();
                
                            break; 
                

                這是我的適配器

                 public class LikersCustomeAdapter  extends ArrayAdapter<LikersComment>{
                Context context;
                List<LikersComment> items;
                Bitmap bitmap;
                String imageUser = "";
                String filePath_Image = "/Pictures/jehad/joj/";
                
                
                public LikersCustomeAdapter(Context context, int textViewResourceId,
                        List<LikersComment> objects) {
                    super(context, textViewResourceId, objects);
                    // TODO Auto-generated constructor stub
                    this.context=context;
                }
                
                public View getView(final int position, View convertView, ViewGroup parent) {
                    Log.d("View likers List", "View>>>>>>>>");
                    likerscommentholder h = null;
                    View v = convertView;
                
                    Log.v("items getName", items.get(position).getName());
                    LayoutInflater vi = (LayoutInflater) context
                            .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
                
                    if (v == null) {
                        v = vi.inflate(R.layout.likerscustomelist,null);
                        h = new likerscommentholder();
                    h.likersimg=(ImageView)v.findViewById(R.id.likersImg);
                    h.likersname=(TextView)v.findViewById(R.id.likersName); 
                
                        v.setTag(h);
                } else {
                    h = (likerscommentholder) v.getTag();
                }
                
                
                
                    imageUser = items.get(position).getId() + items.get(position).getRand();
                    boolean flag_ImagePath = Methods.checkIfImage_DirExists(filePath_Image
                            + imageUser);
                    if (flag_ImagePath == true) {
                        Log.v("flag_ImagePath", String.valueOf(flag_ImagePath));
                        bitmap = Methods.displayBitmapImage(imageUser);
                        h.likersimg.setImageBitmap(bitmap);
                    }
                    h.likersname.setText(items.get(position).getName());
                    return v;
                
                
                }
                }
                 class likerscommentholder {
                ImageView likersimg;
                TextView likersname;
                
                 }
                

                這是列表視圖

                likers_list.xml

                likers_list.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" >
                
                <ListView
                    android:id="@+id/ListLikersList"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" >
                </ListView>
                

                這是自定義布局

                likerscustomelist.xml

                likerscustomelist.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" >
                
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" >
                
                    <ImageView
                        android:id="@+id/likersImg"
                       android:layout_width="65dp"
                        android:layout_height="65dp"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentTop="true"
                        android:src="@drawable/ic_launcher" />
                
                    <TextView
                        android:id="@+id/likersName"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentTop="true"
                        android:layout_marginLeft="16dp"
                        android:layout_marginTop="19dp"
                        android:layout_toRightOf="@+id/likersImg"
                        android:text="Medium Text"
                        android:textAppearance="?android:attr/textAppearanceMedium" />
                
                </RelativeLayout>
                
                 </LinearLayout>
                

                推薦答案

                需要使用AlertDialog.Builder -

                參考這個(gè)- 文檔

                編輯 -

                new AlertDialog.Builder(MyActivity.this)
                                    .setAdapter(yourListAdapter, new DialogInterface.OnClickListener() {
                
                                        @Override
                                        public void onClick(DialogInterface dialog, int which) {
                                         //TODO - Code when list item is clicked (int which - is param that gives you the index of clicked item)
                                        }
                                    })
                                    .setPositiveButton("Okay", new DialogInterface.OnClickListener() {
                
                                        @Override
                                        public void onClick(DialogInterface dialog, int which) {
                
                                        }
                                    })
                                    .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                
                                        @Override
                                        public void onClick(DialogInterface dialog, int which) {
                                        }
                                    })
                                    .setTitle("Dialog Title")
                                    .setCancelable(false)
                                    .show();
                

                這篇關(guān)于對(duì)話框中的自定義 ListView的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                How to detect Location Provider ? GPS or Network Provider(如何檢測(cè)位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                Get current location during app launch(在應(yīng)用啟動(dòng)期間獲取當(dāng)前位置)
                locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                    <small id='4Zv8K'></small><noframes id='4Zv8K'>

                  1. <tfoot id='4Zv8K'></tfoot>
                      <tbody id='4Zv8K'></tbody>
                    <i id='4Zv8K'><tr id='4Zv8K'><dt id='4Zv8K'><q id='4Zv8K'><span id='4Zv8K'><b id='4Zv8K'><form id='4Zv8K'><ins id='4Zv8K'></ins><ul id='4Zv8K'></ul><sub id='4Zv8K'></sub></form><legend id='4Zv8K'></legend><bdo id='4Zv8K'><pre id='4Zv8K'><center id='4Zv8K'></center></pre></bdo></b><th id='4Zv8K'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4Zv8K'><tfoot id='4Zv8K'></tfoot><dl id='4Zv8K'><fieldset id='4Zv8K'></fieldset></dl></div>

                    <legend id='4Zv8K'><style id='4Zv8K'><dir id='4Zv8K'><q id='4Zv8K'></q></dir></style></legend>

                      <bdo id='4Zv8K'></bdo><ul id='4Zv8K'></ul>
                        • 主站蜘蛛池模板: 欧美一级淫片免费视频黄 | 久草热播 | 一区二区三区小视频 | 狠狠的干| 91精品国产一区二区在线观看 | 日韩精品一区二区三区中文在线 | 在线观看中文字幕dvd播放 | 欧美在线一区二区三区 | 国产在线拍偷自揄拍视频 | 精品一区二区三区中文字幕 | 国产高清精品一区二区三区 | a级黄色片在线观看 | 日本久久久久久久久 | 亚洲国产aⅴ成人精品无吗 综合国产在线 | 亚洲精品在线视频 | 国产精品黄 | 一区二区三区四区在线视频 | 欧美日韩亚洲国产综合 | 国产真实精品久久二三区 | 国产精品成人av | 国产视频中文字幕 | 国产蜜臀97一区二区三区 | 国产区精品在线观看 | 国产综合在线视频 | 日本一区二区影视 | 久久久精选 | 久久久久国产一区二区三区四区 | 激情六月丁香婷婷 | 人人干视频在线 | 成人精品福利 | 91视频在线观看 | 国产在线中文字幕 | 美国一级黄色片 | 国产粉嫩尤物极品99综合精品 | 久久精品二区亚洲w码 | 天天拍天天操 | 黄色在线免费观看视频 | 日韩1区2区 | 日韩成人中文字幕 | 99精品一区二区 | 日本高清视频在线播放 |