小编Aja*_*tha的帖子

Android Volley是否支持SSL?

有谁知道Volley是否支持Android中的SSl?有没有办法通过Volley支持SSL?

ssl https android android-studio android-volley

10
推荐指数
1
解决办法
2万
查看次数

如何解决android studio加载项目?无法加载项目:java.lang.IllegalStateException:@NotNull方法

我试图在Android studio中重新打开该项目,但它显示消息"无法加载项目:java.lang.IllegalStateException:@NotNull方法com/intellij/openapi/progress/ProgressManager.getInstance不能返回null".

在此输入图像描述

如何解决这个问题呢?我已经尝试重启Android Studio.但问题仍然存在

android android-studio

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

如何在 Modal BottomSheet 对话框中添加底部布局?

我想使用BottomSheetDialogFragment. 但问题是底部布局在我拖动时滚动。我希望底部布局始终在底部,直到BottomSheetDialogFragment被解雇。

请找到截图

ButtonSheetDialogFragment

这是我的代码

bottomsheet_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <!--The main content goes over here-->
    </LinearLayout>

    <!--The footer view-->
    <LinearLayout
        android:id="@+id/footer_purchase_layout"
        android:layout_width="match_parent"
        android:layout_height="52dp"
        android:layout_gravity="bottom"
        android:orientation="horizontal"
        android:weightSum="1">

        <TextView
            android:id="@+id/txt_cancel_purchase"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:gravity="left|center_vertical"
            android:text="CLOSE"
            android:textSize="14sp" />

        <TextView
            android:id="@+id/txt_item_purchase_action"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:gravity="right|center_vertical"
            android:text="ADD STICKERS"
            android:textSize="14sp" />

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

ModalBottomSheetFragment.java

public class ModalBottomSheetFragment extends BottomSheetDialogFragment {

    public ModalBottomSheetFragment() {}

    private BottomSheetBehavior.BottomSheetCallback mBottomSheetBehaviorCallback = new BottomSheetBehavior.BottomSheetCallback() {

        @Override
        public void onStateChanged(@NonNull View …
Run Code Online (Sandbox Code Playgroud)

java android dialog

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

如何在Android ButtomSheetDialogFragment 中设置左右边距?

我试图在ButtonSheetDialogFragment布局中设置 Margin但它不起作用。我试图从布局和编程中设置边距,但结果相同

这是我的 XML 文件 layout_bts_item.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="10dp"
    android:background="#00000000">
   <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </LinearLayout>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)

这是我的java代码

        public class ButtomSheetFragment extends BottomSheetDialogFragment {
    
        private BottomSheetBehavior.BottomSheetCallback mBottomSheetBehaviorCallback = new BottomSheetBehavior.BottomSheetCallback() {
          @Override
            public void onStateChanged(@NonNull View bottomSheet, int newState)      {
                if (newState == BottomSheetBehavior.STATE_HIDDEN) {
                    dismiss();
                }
    
            }
    
            @Override
            public void onSlide(@NonNull View bottomSheet, float slideOffset) {
            }
        };
    
        @Override
        public void setupDialog(Dialog dialog, int style) {
            super.setupDialog(dialog, style);
    
            View contentView = View.inflate(getContext(),         R.layout.layout_bts_item, null); …
Run Code Online (Sandbox Code Playgroud)

layout android fragment bottomsheetdialogfragment

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

Android中的getIntent()和新Intent()有什么区别?

我喜欢这个

第一种方式

Intent intent = new Intent();
intent.putExtra("isLoggedIn",true);
setResult(RESULT_OK,intent);
Run Code Online (Sandbox Code Playgroud)

第二种方式

Intent intent = getIntent();
intent.putExtra("isLoggedIn",true);
setResult(RESULT_OK,intent);
Run Code Online (Sandbox Code Playgroud)

两者都可以给出相同的结果.我想知道这两者之间的实际差异

java android android-studio

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