-2

How can i add bottom sheet activity?? i cant use fragment cause this is a VPN tool which i am about to reskin, and i wants to load VPN ips from bottom sheet, but whenever i try to load bottom sheet : the layout pops up but VPN ip doesnt shows, it keeps loading... can somebody explain how i can fix this issue?? here is the code i am using....

public void onClick(View v) {

            sheetDialog = new BottomSheetDialog(UIActivity.this,R.style.BottomSheetStyle);
            View view= LayoutInflater.from(UIActivity.this).inflate(R.layout.activity_choose_server,
                    (LinearLayout)findViewById(R.id.sheet));

            sheetDialog.setContentView(view);
            sheetDialog.show();

        }
  • So the bottom sheet is working but the problem is what you are loading inside of it, the code you posted is a working code, you should post the code you are using inside your bottom sheet that is causing the infinite load. Reference to the activity_choose_server fragment – Gastón Saillén Aug 10 '21 at 19:33
  • i cant use fragment cause its activity which contains to load servers – Hexor Here Aug 10 '21 at 19:40
  • That's ok but inside your activity_choose_server you should have xml that corresponds to any logic when inflated, where is that code ? – Gastón Saillén Aug 10 '21 at 19:41
  • when i click through it, it loads layout but not the server so it keeps loading & loading... but in the normal button of load servers works to load layout with server ips – Hexor Here Aug 10 '21 at 19:42

1 Answers1

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

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:theme="@style/ToolbarTheme"
        app:title="@string/select_country_server" />
</LinearLayout>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/colorAccent">

    <ProgressBar
        android:id="@+id/regions_progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:theme="@style/ProgressBarTheme"/>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/regions_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:listitem="@layout/region_list_item"
        tools:visibility="visible" />
</RelativeLayout>
  • Sorry i wasnt able paste full code because this site wasn't giving me permission, i am new posting here but i always follow this site about various problem ans solvement – Hexor Here Aug 10 '21 at 20:00