小编raf*_*007的帖子

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

Codeigniter 3会话无法使用PHP 7.1.4

我有一个内置的应用程序Codeigniter 3 HMVC.该应用程序在PHP 5.6版本上运行良好,但在升级我的PHP版本后,7.1.4我无法登录到我的应用程序.完成检查后,我发现该会话根本没有设置.

我回到PHP 5.6并且会话再次正常工作,而切换到PHP 7.1.4 会导致"会话不工作"问题.

我尝试改变一些配置值,如cookie前缀和cookie保存名称等,似乎没有什么可以解决它.

谁能请帮忙.

php session codeigniter-3 codeigniter-hmvc php-7.1

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

更改 Android 工具栏中复选框菜单项的颜色

如何更改工具栏子菜单中未选中菜单项的颜色?

我知道选中状态是由accentColor相应主题的定义的。但是我找不到为未选中状态定义颜色的方法。

带有检查的工具栏子菜单 需要说明的是:我无法使用自定义布局 XML 定义工具栏的菜单项,而且我无法直接访问视图对象和复选框。

像这样的菜单定义如下:

<menu>
        <item
                android:id="@+id/sortByDescriptionDescendingAction_mediumDark"
                android:icon="@drawable/ic_sort_white_24dp"
                android:title="@string/sortByDescriptionDescendingAction"
                android:checkable="true"/>
        <item
                android:id="@+id/sortByDescriptionAscendingAction_mediumDark"
                android:icon="@drawable/ic_sort_white_24dp"
                android:title="@string/sortByDescriptionAscendingAction"
                android:checkable="true"/>
        <item
                android:id="@+id/sortByDateDescendingAction_mediumDark"
                android:icon="@drawable/ic_sort_white_24dp"
                android:title="@string/sortByDateDescendingAction"
                android:checkable="true"
                android:checked="true"/>
        <item
                android:id="@+id/sortByDateDescAction_mediumDark"
                android:icon="@drawable/ic_sort_white_24dp"
                android:title="@string/sortByDateAscendingAction"
                android:checkable="true"/>
</menu>
Run Code Online (Sandbox Code Playgroud)

checkbox android themes android-toolbar

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

删除工具栏和tablayout之间的空间间隔

我有一个带有TabLayout的AppBarLayout,该片段位于具有工具栏的Activity中.但是工具栏和TabLayout之间出现了一个空格,我不知道它来自哪里.

在此输入图像描述

fragment_packs.xml

<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="studio.com.archeagemanager.EventosFragment">

    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        tools:context="studio.com.archeagemanager.PacksFragment">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:tabGravity="fill"
                app:tabMode="fixed"
                app:tabTextColor="#ffffff" />
        </android.support.design.widget.AppBarLayout>

        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@android:color/white"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    </android.support.design.widget.CoordinatorLayout>

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

PacksFragment.java

public class PacksFragment extends Fragment {


    public PacksFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_packs, container, false);

        AppBarLayout appBarLayout = (AppBarLayout) view.findViewById(R.id.appbar); …
Run Code Online (Sandbox Code Playgroud)

java xml android android-layout android-fragments

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

Android在线性布局中动态添加EditText

我试图使用按钮在我现有的editText字段下动态添加editText字段.目前按下按钮什么都不做.这是我的代码:

XML:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
android:background="#d4cfcd">
tools:context="com.zdowning.decisionmaker.MainActivity">


<LinearLayout
    android:id="@+id/linearLayoutMain"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:gravity="center"
        android:hint="Enter Your Question Here"
        android:layout_marginBottom="20dp"
        android:layout_marginTop="20dp"/>

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

    <EditText
        android:id="@+id/editText3"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:gravity="center"
        android:hint="Enter Answer #2" />

    <EditText
        android:id="@+id/editText2"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:gravity="center"
        android:hint="Enter Answer #1" />

    <EditText
        android:id="@+id/editText4"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:gravity="center"
        android:hint="Enter Answer #3" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center">

        <Button
            android:id="@+id/add_button"
            style="?android:attr/borderlessButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/colorPrimary"
            android:text="+"
            android:textColor="@android:color/background_light"
            android:textSize="18sp"/>

        <View …
Run Code Online (Sandbox Code Playgroud)

java android dynamic android-edittext

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

如何在自定义对话框中添加单选组 onchecked 侦听器

我有一个包含单选按钮的自定义对话框,但是当我添加 oncheckedchangelistener 时,我的应用程序崩溃了。可能是什么问题呢?

提前致谢!:D

这是我的代码:

GridViewAdapter adapter = new GridViewAdapter(alcoholType.this, images,names);
    gridView.setAdapter(adapter);
    gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                                int position, long id) {

            final Dialog dialog = new Dialog(context);
            dialog.setContentView(R.layout.alcoholdialog);
            dialog.setTitle("ORDER " + names.get(position));

            radioQuantity = (RadioGroup) findViewById(R.id.radioQuantity);
            quantity1 = (RadioButton) findViewById(R.id.quantity1);
            quantity2 = (RadioButton) findViewById(R.id.quantity2);

            radioQuantity.clearCheck();

            radioQuantity.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

                        @Override
                        public void onCheckedChanged(RadioGroup group, int checkedId) {


                        }

                    });

            dialog.show();
        }
    });
Run Code Online (Sandbox Code Playgroud)

这是错误跟踪:

E/AndroidRuntime: FATAL EXCEPTION: main
              Process: com.example.gin.ordering, PID: 22005
              java.lang.NullPointerException: Attempt to invoke …
Run Code Online (Sandbox Code Playgroud)

android radio-group radio-button

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

在 MPAndroidChart 中单击任何条时如何停止突出显示?

我正在使用MPAndroidChart库的barChart 。我的问题是,每当我单击该条形图的任何条形时,它的颜色都会发生类似叠加的变化。我尝试了几种技术,但没有任何效果。我试过以下代码:

    barChart.setHighlightPerTapEnabled(false);
Run Code Online (Sandbox Code Playgroud)

上线为我做这个技巧,但它也禁用了点击事件,这意味着如果我设置HighlightPerTapEnabled = false然后我的 onValue 选择的侦听器不再触发。我也尝试过以下两行,但没有任何效果符合我的预期。

    mChart.setTouchEnabled(false);
    mChart.setDrawBarShadow(false);
Run Code Online (Sandbox Code Playgroud)

当用户单击该条形图的任何条时,我只想删除这种颜色变化。提前致谢。

android mpandroidchart

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

Android API 30 getPackageManager.resolveActivity() 使用 ACTION_VIEW 返回 null

我正在 android studio 4.0 中尝试 codelabs 的一些代码,并在应用程序中使用以下代码:

String uri = uritext.getText().toString();//uritext is an editText view
Uri webpage = Uri.parse(uri);
Intent intent = new Intent(Intent.ACTION_VIEW, webpage);
if(intent.resolveActivity(getApplicationContext().getPackageManager())!=null){
    startActivity(intent);
}
else {
    Log.d("implicitintent:","cant handle this implicit intent!");
    Toast toast = Toast.makeText(MainActivity.this,"cant open website:" + uri,Toast.LENGTH_SHORT);
    toast.show();
}
Run Code Online (Sandbox Code Playgroud)

我已经在两个不同的 AVD 中尝试了上述代码,当我尝试在按钮单击事件中执行上述代码时,它们都显示了 toast 消息。这意味着resolveActivity() 返回一个null。我找不到任何可能的原因,因为我发现两个 AVD 上都安装了 google chrome。Logcat 显示以下几行:

2020-07-14 17:39:05.829 392-392/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-14 17:39:08.229 395-395/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open …
Run Code Online (Sandbox Code Playgroud)

android-intent chrome-custom-tabs android-studio-4.0

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

Facebook帐户短信集成在Android上失败

Facebook Account kit短信集成无效.当我使用来自github的代码时,它可以通过此应用程序中已集成的帐户进行短信发送. https://github.com/fbsamples/account-kit-samples-for-android/tree/master/samples/AccountKitSimpleSample

但是,当我创建应用程序Facebook account kit,复制Client Token和App Id.然后它没有用."发生系统问题.请再试一次"发生错误如何解决此问题?

android facebook

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

日期解析yyyy-MM-dd'T'HH:mm:ss在Android中

我的字符串日期 - > 2016-10-02T00:00:00.000Z.我想从这个字符串中只获取日期.我试图解析下面的编码,但它让我错误!我的格式与字符串中提到的格式完全相同.任何答案?

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSSZ");
        try {
            Date myDate = sdf.parse( dateofJoining.replaceAll( "([0-9\\-T]+:[0-9]{2}:[0-9.+]+):([0-9]{2})", "$1$2" ) );
            System.out.println("Date only"+ myDate );
        } catch (ParseException e) {
            e.printStackTrace();
        }
Run Code Online (Sandbox Code Playgroud)

我也厌倦了下面的代码,

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");  
try {  
    Date date = format.parse(dtStart);  
    System.out.println(date);  
} catch (ParseException e) {  
    // TODO Auto-generated catch block  
    e.printStackTrace();  
}
Run Code Online (Sandbox Code Playgroud)

我得到的错误

java.text.ParseException: Unparseable date: "2016-10-02T00:00:00.000Z" (at offset 19)
05-12 00:18:36.613 4330-4330/com.vroom.riderb2b W/System.err:     at java.text.DateFormat.parse
Run Code Online (Sandbox Code Playgroud)

java android date

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