小编Van*_*hed的帖子

如何在scrollview android中使用多个expandablelistview?

我想在单个屏幕中设置3个expandablelistview我想添加多个expandablelistview

XmlLayout

//this is my scorllview
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    tools:context=".fragments.FragmentTestWellnessScoreBoard">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">


        <LinearLayout
            android:id="@+id/llHealth"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tvHealthTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:textStyle="bold"
                android:layout_margin="@dimen/margin_10"
                android:text="Health"/>

            <ExpandableListView
                android:id="@+id/elHealth"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </LinearLayout>


        <LinearLayout
            android:id="@+id/llChallenge"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tvChallengeTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:textStyle="bold"
                android:layout_margin="@dimen/margin_10"
                android:text="Challenge"/>

            <ExpandableListView
                android:id="@+id/elChallenge"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </LinearLayout>


        <LinearLayout
            android:id="@+id/llRisk"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tvRiskTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:textStyle="bold"
                android:layout_margin="@dimen/margin_10"
                android:text="Risk"/>

            <ExpandableListView
                android:id="@+id/elRisk"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </LinearLayout>

    </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我想在用户点击时设置逐个适配器我不知道如何设置多个expandableList? Java文件 …

android expandablelistview expandablelistadapter android-layout

8
推荐指数
1
解决办法
363
查看次数

ANDROID - DialogFragment 上的 setOnDismissListener

我有一个DialogFragment用于TimePickerDialog在按下a时显示 a button,我想将按钮的文本更改为新的时间设置。

我的问题是我不能叫setOnDismissListenerDialogFragment从我的Activity

这是我的 DialogDragment

 public class TimePickerFragment extends DialogFragment
        implements TimePickerDialog.OnTimeSetListener {

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        int hour = Application.getSettings().getInt("hour", 11);
        int minute = Application.getSettings().getInt("minute", 11);

        // Create a new instance of TimePickerDialog and return it
        return new TimePickerDialog(getActivity(), this, hour, minute,
                DateFormat.is24HourFormat(getActivity()));
    }

    @Override
    public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
        FirstTimeLaunchSettingsActivity.hours = hourOfDay;
        FirstTimeLaunchSettingsActivity.minutes = minute;

    }
}
Run Code Online (Sandbox Code Playgroud)

这就是我如何称呼这个 DialogFragment …

android android-dialogfragment

2
推荐指数
2
解决办法
5659
查看次数

我们可以在领域使用gson模型吗?当我尝试显示构建时间错误时

当我尝试在显示错误时构建或运行项目时,GSON模型意味着Wich我将在Web服务响应中使用,而我正在使用领域数据库FirstTime,因此

我的模特班

InstaSave.class

    package model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import io.realm.RealmObject;

// i extend realm in my gson model 
public class InstaSave extends RealmObject {

    @SerializedName("provider_url")
    @Expose
    private String providerUrl;
    @SerializedName("media_id")
    @Expose
    private String mediaId;
    @SerializedName("author_name")
    @Expose
    private String authorName;
    @SerializedName("height")
    @Expose
    private Object height;
    @SerializedName("thumbnail_url")
    @Expose
    private String thumbnailUrl;
    @SerializedName("thumbnail_width")
    @Expose
    private Integer thumbnailWidth;
    @SerializedName("thumbnail_height")
    @Expose
    private Integer thumbnailHeight;
    @SerializedName("provider_name")
    @Expose
    private String providerName;
    @SerializedName("title")
    @Expose
    private String title;
    @SerializedName("html")
    @Expose
    private String html;
    @SerializedName("width")
    @Expose
    private Integer width; …
Run Code Online (Sandbox Code Playgroud)

android realm gradle build.gradle

1
推荐指数
1
解决办法
273
查看次数