小编Sta*_*olm的帖子

如何设置actionBar弹出背景?

我正在尝试更改弹出背景 android.support.v7.widget.toolbar

在尝试这个,但没有帮助:

<style name="DonorUaTheme.ActionBar.Solid" parent="Widget.AppCompat.Toolbar">
        <item name="android:background">@color/material_drawer_primary</item>
        <item name="android:displayOptions">showTitle|showHome</item>
        <item name="android:popupBackground">@color/material_drawer_primary</item>
    </style>
Run Code Online (Sandbox Code Playgroud)

我正在使用android v15,所以我不能只设置<item name="android:popupTheme">,但是我仍然需要更改弹出背景。

会很高兴有帮助

android popup toolbar android-actionbar

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

如何从对话框中删除阴影?安卓

我正在使用AppCompatDialog构建对话框界面。

我的目标是在显示对话框视图时消除阴影?

这是代码示例:

private void showWrongLoginPassDialog(String message){
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(getString(R.string.ad_login_error_title));
        builder.setMessage(message);
        builder.setPositiveButton(getString(R.string.ad_login_error_positive),
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.cancel();
                    }
                });
        builder.show();
    }
Run Code Online (Sandbox Code Playgroud)

android android-alertdialog

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

将String转换为int返回NumberFormatException

我从API接收下一个字符串:

String userId = "4463570100035744";
Run Code Online (Sandbox Code Playgroud)

我需要将它转换为int,所以我尝试了下一个代码:

try {
     int id = Integer.parseInt(userId);
} catch (NumberFormatException e){
     e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

但我还是抓住了......

可能是什么原因?

android exception valueconverter numberformatexception

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

SQLite错误Android - 索引-1请求

我试图从我的数据库中获取一些数据,但我得到下一个错误:

Index -1 requested, with a size of 1
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

sUri = DB_Contract.ChatListEntry.buildUriForCurrentRoom(sNewMessageRoomId);
        sCursor = sActivity.getContentResolver().query(sUri, sChatProjection, null, null, null);

        messageCount = sCursor.getInt(NEW_MESSAGE_COUNT) + 1;
Run Code Online (Sandbox Code Playgroud)

我在尝试获取messageCount时遇到此错误;

sqlite android

-2
推荐指数
1
解决办法
39
查看次数