小编Sha*_*nth的帖子

在API级别19以下的Android中选择文件或图像时,如何限制Google驱动器选项不显示?

我是Android的新手,我要求在API级别19以下的设备上选择文件.

我试过了

private void chooseFile() {
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
             intent.setType("application/pdf|file");
        } else {
             intent.setType("image/*|application/pdf");
        }
        startActivityForResult(intent, PICKFILE_REQUEST_CODE);
}
Run Code Online (Sandbox Code Playgroud)

现在我不希望Google驱动器作为选项出现,我想要文件管理器作为选项.我想用意图来做这件事.

任何人都可以建议我如何实现这一目标?

android android-intent

8
推荐指数
2
解决办法
2230
查看次数

如何更改颜色并在python曲面图上添加网格线?

我是新来的,请保持温柔.我正在做一个项目,要求我绘制八极图.我使用了python surface plot并得到了这样的结果:

我得到的数字

但是,我的教授想要这样的事情:

我想要的数字

请忽略图中的226Ra.我想将我的绘图颜色更改为红色,并添加这样的网格线.有什么办法可以吗?我将非常感激.这是我的代码:

import numpy as np;
from matplotlib import cm, colors;
import cmath;
import matplotlib.pyplot as plt;
from mpl_toolkits.mplot3d import Axes3D;
import scipy.special as sp;




l = 3    # degree
m = 0    # order
PHI, THETA = np.mgrid[0:2*np.pi:300j, 0:np.pi:150j]
R = sp.sph_harm(m, l, PHI, THETA).real

s = 1
X = (s*R*0.28+1) * np.sin(THETA) * np.cos(PHI)
Y = (s*R*0.28+1) * np.sin(THETA) * np.sin(PHI)
Z = (s*R*0.29+1) * np.cos(THETA)

norm = colors.Normalize()
fig, ax = plt.subplots(subplot_kw=dict(projection='3d'), figsize=(14,10))
m …
Run Code Online (Sandbox Code Playgroud)

python matplotlib

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

Move RecyclerView together with the Swipe Refresh Layout indicator (like Instagram pull to refresh)

I want to move Recyclerview together with the Swipe Refresh Layout indicator (do not place the indicator above the Recyclerview, but Recyclerview should be appeared below of swipe refresh indicator).

我在一个SwipeRefreshLayout. 相应的 XML 如下。

<android.support.v4.widget.SwipeRefreshLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:id="@+id/swipe_refresh_news">

   <android.support.v7.widget.RecyclerView
       android:id="@+id/recycler_view"
       android:scrollbars="vertical"
       android:layout_width="match_parent"
       android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
Run Code Online (Sandbox Code Playgroud)

目前滑动看起来像这样:

看到这张图片

我想要这样的东西,但我不想使用任何第三方库:
看到这张照片

android pull-to-refresh swiperefreshlayout android-recyclerview

7
推荐指数
0
解决办法
644
查看次数

##[error] 错误:进程 '/Library/Frameworks/Mono.framework/Versions/5_18_2/bin/msbuild' 失败,退出代码为 1

我是 Xamarin 的新手,在构建到应用中心时遇到问题,希望有人能给我一些指点,

我的应用程序在 iOS 上构建得很好,但它在 Android 上出现了这个错误,有人能指出我正确的方向吗?

[error]Error: The process '/Library/Frameworks/Mono.framework/Versions/5_18_2/bin/msbuild' failed with exit code 1
Run Code Online (Sandbox Code Playgroud)

android xamarin visual-studio-app-center

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

Android BottomSheetDialog布局有按钮,onclick导航到活动

我有我的活动调用的BottomSheetDialog布局xml文件.BottomSheetDialog有2个按钮.点击BottomSheetDialog里面的按钮,它应该带我到另一个Activity.

相关的BottomSheetDialog布局图

main_layout.xml

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="#fff"
    android:orientation="vertical"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.ezeelearn.colorstonz.ezeelearn.PhysicsTestSelectorActivity"
    tools:showIn="@layout/app_bar_physics_lesson">


    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal"
            android:id="@+id/lesson_list">



        </TableLayout>


    </ScrollView>

    <include layout="@layout/bottom_sheet_layout" />


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

bottom_sheet_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:id="@+id/RelativeLayoutSheet"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    app:layout_behavior="@string/bottom_sheet_behavior"
    android:background="#ffffff"
    app:behavior_hideable="true"
    android:padding="20dp"
    >

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TableRow
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:weightSum="2">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:paddingRight="50dp"
                android:paddingLeft="50dp"
                android:paddingTop="20dp"
                android:paddingBottom="20dp"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <Button
                    android:layout_width="100dp"
                    android:layout_height="100dp"
                    android:layout_weight="1"
                    android:background="#fff"
                    android:drawableTop="@drawable/google_cardboard"
                    android:drawablePadding="6dp"
                    android:gravity="left|center"
                    android:height="60dp"
                    android:padding="6dp"
                    android:text="Video"
                    android:id="@+id/bottom_sheet_video_btn"
                    android:textAlignment="center"
                    android:fontFamily="sans-serif-light"
                    android:foreground="?android:attr/selectableItemBackground"
                    android:textColor="#666" />

            </LinearLayout>

            <LinearLayout …
Run Code Online (Sandbox Code Playgroud)

android bottom-sheet

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

如何在netbeans中的ubuntu 16.04中安装xdebug?

每当我尝试运行此代码时

example@testserver:~$ sudo apt-get install php5-xdebug
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php5-xdebug
Run Code Online (Sandbox Code Playgroud)

我收到此错误"E: Unable to locate package php5-xdebug" 请帮助谢谢

php linux ubuntu netbeans xdebug

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

如何阻止Android Studio建议"插入应用程序索引"快速修复?

Android Studio一直建议我添加App Indexing代码.更糟糕的是,当光标在没有其他问题的情况下,它总是显示快速修复图标.

快速修复变得不那么有用,因为需要关心它是否不会"修复"App Indexing问题.第二 - 它令人烦恼,并分散了实际问题的注意力.

如何禁用这个"辉煌"的功能?

android android-studio android-app-indexing

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

自定义字体适用于 XML 预览,但不适用于 Android 中的 RecyclerView

TextView带有自定义字体的代码style="@style/SbTextView.ListTitle"

<TextView
    android:id="@+id/symbolCompany"
    style="@style/SbTextView.ListTitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:singleLine="true"
    android:typeface="normal"
    tools:ignore="MissingPrefix"
    tools:text="@sample/watchlist_companies.json/data/symbol" />
Run Code Online (Sandbox Code Playgroud)

使用@font/sb_proxima带有BOLD 的 自定义字体样式textStyle

<style name="SbTextView.ListTitle" parent="SbTextView">
    <item name="android:fontFamily">@font/sb_proxima</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textSize">@dimen/text_body</item>
    <item name="android:textColor">@color/contentcolor</item>
    <item name="android:lineSpacingMultiplier">1.15</item>
</style>
Run Code Online (Sandbox Code Playgroud)

样式父 SbTextView

<style name="SbTextView" parent="@android:style/TextAppearance"/>
Run Code Online (Sandbox Code Playgroud)

字体系列 @font/sb_proxima

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <font
        android:font="@font/proxima_nova_regular"
        android:fontStyle="normal"
        android:fontWeight="400"

        app:font="@font/proxima_nova_regular"
        app:fontStyle="normal"
        app:fontWeight="400"/>

    <font
        android:font="@font/proxima_nova_regular"
        android:fontStyle="italic"
        android:fontWeight="400"

        app:font="@font/proxima_nova_regular"
        app:fontStyle="normal"
        app:fontWeight="400"/>

</font-family>
Run Code Online (Sandbox Code Playgroud)

在设计预览(在 XML 上)呈现的内容如下图所示

XML 预览

XML 预览

在运行时内部RecyclerView看起来像在 RecylerView 上呈现

在 RecylerView 上渲染

android textview custom-font android-recyclerview

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

如何在Android中的Retrofit中获取标头响应?

这是我的终点:

\n\n
@POST("v4/MyStore/data")\nObservable<Headers> requestStore(@Body MyStoreRequest request);\n
Run Code Online (Sandbox Code Playgroud)\n\n

我试图得到这样的回应:

\n\n
requestService.requestStore(request)\n                .subscribeOn(Schedulers.io())\n                .observeOn(Schedulers.computation())\n                .map(headers -> {\n                   Log.d("Response",""+headers);\n                    return headers;\n                }).subscribe(headers -> {\n                            Log.d("Response",""+headers);\n                        },\n                        error -> {\n                           Log.d("ERRRROOOR","Error");\n                        });\n
Run Code Online (Sandbox Code Playgroud)\n\n

我收到如下错误:

\n\n
Exception: retrofit2.adapter.rxjava.HttpException: HTTP 403 Forbidden\n
Run Code Online (Sandbox Code Playgroud)\n\n

在邮递员中我收到回复:

\n\n
Connection \xe2\x86\x92keep-alive\nContent-Length \xe2\x86\x920\nContent-Type \xe2\x86\x92application/json; charset=utf-8\nDate \xe2\x86\x92Mon, 03 Sep 2018 18:47:30 GMT\nMYid \xe2\x86\x92f028df50-c8c5-4cce-92e7-70130345ba46\n
Run Code Online (Sandbox Code Playgroud)\n\n

我在这里做错了什么?

\n

android retrofit

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

在STS / Eclipse中找不到或加载主类

我的一个项目的软件包中有一个主要方法。说,包裹是com.ant.car。我正在尝试运行和/或调试此主要方法,并且不断收到错误消息Could not find or load main class com.ant.car

我已经搜索了这个问题,似乎无法弄清楚出什么问题了。

1)我检查了运行配置。在运行->运行配置中,我检查了Main类是否为com.ant.car。

2)我已经检查了构建路径。如果右键单击该项目,则选择“构建”->“构建路径”,然后在“库”选项卡下确保没有丢失带有红色X的文件夹。

不太确定还要做什么。有什么建议么?

java eclipse spring class package

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