小编use*_*307的帖子

在Android中更改背景popupMenu

我试图改变popupmenu的背景,但我的实现不起作用.

这是我的代码:

<style name="MyHoloLight" parent="android:Theme.Holo.Light">
    <item name="android:popupMenuStyle">@style/popupMenuStyle</item>
</style>
<style name="popupMenuStyle" parent="@android:style/Widget.PopupMenu">
    <item name="android:popupBackground">@color/bgPopumMenu</item>
</style>
Run Code Online (Sandbox Code Playgroud)

在AndroidManifest.xml中应用

<application
        android:hardwareAccelerated="true"
        android:label="@string/app_name"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/MyHoloLight">
Run Code Online (Sandbox Code Playgroud)

android android-theme android-styles android-popupwindow

11
推荐指数
3
解决办法
2万
查看次数

无法解析符号 WebSecurityConfigurerAdapter

我尝试在我的 java 应用程序中创建基本身份验证。对于他们,我在 gradle 文件中使用了这个依赖项

dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: '1.5.9.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.9.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-parent', version: '1.3.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: '1.4.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb', version: '1.5.9.RELEASE'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-web', version: '2.7'
compile('org.hibernate:hibernate-core')    
testCompile group: 'junit', name: 'junit', version: '4.12'
Run Code Online (Sandbox Code Playgroud)

}

当我实现扩展类 WebSecurityConfigurerAdapter 想法时显示错误 …

spring-security spring-boot

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

如何在sqlite中使用regexp

请提示,如何在SQLite中使用REGEXP?

实现:

SELECT field FROM table WHERE field REGEXP '123'
Run Code Online (Sandbox Code Playgroud)

它不起作用. Error: no such function: REGEXP

regex android-sqlite

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

片段中的Android onActivityResult

我尝试在片段中获得结果。片段中的代码

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (resultCode != Activity.RESULT_OK) return

    val bundle = data?.extras
    when (requestCode) {
        LicenseActivationActivity.REQUEST_RESULT_COUNT_ENTERPRISE ->
     //
    }
}
Run Code Online (Sandbox Code Playgroud)

这段代码被调用。而且还有 DrawerActivity 中的 onActivityResult 方法

是否只在片段中调用 onActivityResult ?

更新

DrawerActivity 中的这段代码

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (resultCode == Activity.RESULT_OK) {
        WayBillsActivity.start(this)
        finish()
    }
}
Run Code Online (Sandbox Code Playgroud)

不知为何,也满足了,不过是在fragment中的onActivityResult之后。

android fragment kotlin startactivityforresult

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

在post请求中将JSON传输到服务器

服务器有两个参数:StringJSON.提示,正确我JSON在POST请求中传输和字符串?

try {
    HttpClient httpClient = new DefaultHttpClient();
    HttpPost httpPost = new HttpPost("my_url");
    List parameters = new ArrayList(2);
    JSONObject jsonObject = new JSONObject();
    jsonObject.put("par_1", "1");
    jsonObject.put("par_2", "2");
    jsonObject.put("par_3", "3");
    parameters.add(new BasicNameValuePair("action", "par_action"));
    parameters.add(new BasicNameValuePair("data", jsonObject.toString()));
    httpPost.setEntity(new UrlEncodedFormEntity(parameters));
    HttpResponse httpResponse = httpClient.execute(httpPost);
    Log.v("Server Application", EntityUtils.toString(httpResponse.getEntity())+" "+jsonObject.toString());

} catch (UnsupportedEncodingException e) {
    Log.e("Server Application", "Error: " + e);
} catch (ClientProtocolException e) {
    Log.e("Server Application", "Error: " + e);
} catch (IOException e) {
    Log.e("Server Application", …
Run Code Online (Sandbox Code Playgroud)

post android json http-post

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

Android recyclerview defauilitemanimator 更改持续时间

我使用 recyclerview 来动态列表。插入和删除项目后,recyclerview 会执行急剧更新。我使用 DefaultItemAnimator 来实现我列出的更漂亮的更新。

optionList2.itemAnimator = DefaultItemAnimator()
Run Code Online (Sandbox Code Playgroud)

我想尝试增加动画的延迟。你能告诉我该怎么做吗?

animation android android-recyclerview

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