第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

setOnItemClickListener() 不適用于 Fragment 中的

setOnItemClickListener() 不適用于 Fragment 中的

翻過高山走不出你 2023-10-19 21:44:48
你好,早上好,在我看來,我無法處理 setOnItemClickListener我正在嘗試創(chuàng)建一個(gè)在 gridview 中動(dòng)態(tài)列出已安裝應(yīng)用程序的應(yīng)用程序。我能夠以 gridview 形式顯示應(yīng)用程序,但無法使這些項(xiàng)目可單擊。當(dāng)我點(diǎn)擊這些項(xiàng)目時(shí)什么也沒有發(fā)生。setOnItemClickListener 內(nèi)的代碼不會(huì)在單擊事件時(shí)觸發(fā)。<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context=".Tab2profile">    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        tools:ignore="UselessParent">//my scrollview         <ScrollView            android:layout_width="match_parent"            android:fillViewport="true"            android:layout_height="match_parent">            <RelativeLayout                android:id="@+id/MainRLyout"                android:layout_width="match_parent"                android:orientation="vertical"                android:layout_height="wrap_content">                <RelativeLayout                    android:id="@+id/girislayout"                    android:layout_alignParentTop="true"                    android:layout_width="match_parent"                    android:layout_height="wrap_content">                </RelativeLayout>                </syr13.comapp4.Custum_Adapters.ExpandableHeightGridView>            </RelativeLayout>        </ScrollView>    </RelativeLayout></FrameLayout>
查看完整描述

1 回答

?
臨摹微笑

TA貢獻(xiàn)1982條經(jīng)驗(yàn) 獲得超2個(gè)贊

我認(rèn)為你可以更改你的代碼

button.setOn Item ClickListener(this);

按鈕.setOnClickListener(this);

例如 :-


    public class MainActivity extends AppCompatActivity {

        @Override

        protected void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);

            setContentView(R.layout.activity_main);

            Button button = findViewById(R.id.button);

            button.setOnClickListener(this);

        }

        @Override

        public void onClick(View v) {

            switch (v.getId())

            {

                case R.id.button:

                    //Do Something

                    break;

            }

        }

    }


查看完整回答
反對(duì) 回復(fù) 2023-10-19
  • 1 回答
  • 0 關(guān)注
  • 116 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)