小编fil*_*ski的帖子

什么是Mac上的JDK路径?

我只在工作时使用Mac,我需要将JAVA_HOME设置为正确的JDK路径.我下载了JDK,安装了它,现在我无法在任何地方找到它.我正在寻找解决方案的互联网,但没有文件夹库/ Java.

java macos

318
推荐指数
5
解决办法
53万
查看次数

在没有流行库的情况下在Android中刷新

我想在Android应用程序中实现pull-to-refresh,但我不想使用可在因特网上使用的pull-to-refresh库,因为它对于我正在使用的gridView来说太慢了.所以我想手工实现它,你知道怎么做吗?或者我应该从GridView使用哪些方法?

android gridview

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

如何禁用ScrollView滚动?

试图解决这个问题:如何禁用pullToRefreshScrollView从听取触摸我想知道它有一个解决方案,阻止ScrollView处理onTouchEvents而不为它创建可自定义的类?为什么所有的方法都喜欢

gridView.getParent().requestDisallowInterceptTouchEvent(true);

mScrollView.setOnTouchListener(new OnTouchListener() {
           @Override
           public boolean onTouch(View v, MotionEvent event) {
              return false;
           }
        });
Run Code Online (Sandbox Code Playgroud)

不起作用?他们有什么问题?谷歌为什么实施不起作用的方法?

android scrollview

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

由于GCM SenderId Android无法生成APK发布

我已在我的应用中实施了GCM(Google Cloud Messaging).Google Play服务库已自动生成values.xml,其中我senderId是:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="gcm_defaultSenderId">123</string>
</resources>
Run Code Online (Sandbox Code Playgroud)

问题是我有其他语言环境,App Release期间的Lint给了我一个错误: Error:(3) Error: "gcm_defaultSenderId" is not translated in "fr" (French) [MissingTranslation]

因为它是自动生成的我无法设置translable = false.我应该怎么解决这个问题?

android lint google-cloud-messaging

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

如何在导航视图中定位菜单项?

我的问题是有关最近发布Navigation ViewDesign Support Library. 菜单

我想Log In在底部定位Navigation View,我该怎么做?我的菜单XML现在看起来像这样:

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

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/navigation_sub_item_1"
            android:icon="@drawable/ic_action_event"
            android:title="@string/home" />
        <item
            android:id="@+id/navigation_sub_item_2"
            android:icon="@drawable/ic_action_person"
            android:title="@string/profile" />
        <item
            android:id="@+id/navigation_sub_item_3"
            android:icon="@drawable/ic_action_labels"
            android:title="@string/tags" />
        <item
            android:id="@+id/navigation_sub_item_4"
            android:icon="@drawable/ic_action_settings"
            android:title="@string/log_in" />
    </group>

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

这是我的布局:

     <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:background="@color/white_1000">

        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar" />

        <android.support.v4.widget.DrawerLayout
            android:id="@+id/drawer_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/toolbar">

            <FrameLayout
                android:id="@+id/content_frame"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" />

            <android.support.design.widget.NavigationView
                android:id="@+id/main_drawer"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_gravity="start"
                app:headerLayout="@layout/drawer_header"
                app:menu="@menu/drawer_menu" /> …
Run Code Online (Sandbox Code Playgroud)

android navigationview

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

实施AppInvites时的结果代码3

我正在尝试实施AppInvites.我已经完成了这里写的所有步骤https://firebase.google.com/docs/invites/android

不断得到RESULT_CODE = 3,我做错了什么?

android google-app-invites

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

KaptContext 无法访问 Context

我想融入fastlane到我的项目中。我已经设置了所有基本内容,现在我想将我的项目部署到测试版。我运行fastlane android beta并出现以下错误。如果我使用 Android Studio 3.1 进行编译,则一切正常。

:app:kaptGenerateStubsReleaseKotline: java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.KaptContext (in unnamed module @0x253fbddb) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x253fbddb
    at org.jetbrains.kotlin.kapt3.KaptContext.<init>(KaptContext.kt:47)
    at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.compileStubs(Kapt3Extension.kt:265)
    at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.generateStubs(Kapt3Extension.kt:215)
    at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:178)
    at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:93)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:97)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:107)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:84)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:374)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:64)
    at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:101)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:365)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:130)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:161)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:63)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:108)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:52)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:92)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:451)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:97)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:218)
    at …
Run Code Online (Sandbox Code Playgroud)

android kotlin fastlane

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

Android Studio中的JavaCV配置

我知道有很多类似的问题,但由于JavaCV等库的开发,很多问题似乎已经过时了.

我使用Android中的视频创作与图像和音频的代码来创建电影,但我有lib导入的问题.

我在JavaCV页面上写道,我把依赖放在gradle中:

compile group: 'org.bytedeco', name: 'javacv', version: '0.9'
Run Code Online (Sandbox Code Playgroud)

现在,我不知道我是否还要做别的事情?

我用过这些进口:

import org.bytedeco.javacpp.avcodec;
import org.bytedeco.javacpp.opencv_core.IplImage;
import org.bytedeco.javacv.FFmpegFrameRecorder;

import static org.bytedeco.javacpp.opencv_highgui.cvLoadImage;
Run Code Online (Sandbox Code Playgroud)

并得到此错误:

Caused by: java.lang.NoClassDefFoundError: java.lang.ClassNotFoundException: org.bytedeco.javacpp.avutil
        at org.bytedeco.javacpp.Loader.load(Loader.java:387)
        at org.bytedeco.javacpp.Loader.load(Loader.java:353)
        at org.bytedeco.javacpp.avformat.<clinit>(avformat.java:13)
        at org.bytedeco.javacv.FFmpegFrameRecorder.<clinit>(FFmpegFrameRecorder.java:106)
        at voidstudio.app.activity.CreateMovieTask.doInBackground(CreateMovieTask.java:46)
        at voidstudio.app.activity.CreateMovieTask.doInBackground(CreateMovieTask.java:21)
Run Code Online (Sandbox Code Playgroud)

Caused by: java.lang.ClassNotFoundException: org.bytedeco.javacpp.avutil
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:217)
Run Code Online (Sandbox Code Playgroud)

 Caused by: java.lang.UnsatisfiedLinkError: Couldn't load jniavutil from loader dalvik.system.PathClassLoader[dexPath=/data/app/voidstudio.app-1.apk,libraryPath=/data/app-lib/voidstudio.app-1]: findLibrary returned null
        at java.lang.Runtime.loadLibrary(Runtime.java:365)
        at java.lang.System.loadLibrary(System.java:521)
        at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
        at org.bytedeco.javacpp.Loader.load(Loader.java:410)
Run Code Online (Sandbox Code Playgroud)

我错过了配置吗?我看过类似的问题,但没有正确的答案.

android javacv

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

用Java编写的StringBuilder

我有一个方法从sdcard(Android)加载文件,然后使用StringBuilder读取它.我正在阅读的文本是用我的母语字符写的,例如ąźż... StringBuilder(或FileInputStream)不能正确地读取它们.我如何设置正确的编码?

这是代码:

File file = new File(filePath);
            FileInputStream fis = null;
            StringBuilder builder = new StringBuilder();

            try {
                fis = new FileInputStream(file);
                int content;
                while ((content = fis.read()) != -1) {
                    builder.append((char) content);
                }

            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try {
                    if (fis != null)
                        fis.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            }
            System.out.println("File Contents = " + builder.toString());
            contactService.updateContacts(builder.toString());
Run Code Online (Sandbox Code Playgroud)

stringbuilder encoding file fileinputstream

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

如何在Android string.xml 中放置特殊交易字符

我需要在我的 string.xml 中放入“TM”(商标)字符,我应该怎么做?

<string name="snap_recipesnap_button">RecipeSnap\&trade;</string>
Run Code Online (Sandbox Code Playgroud)

我有这样的东西,但它不起作用

xml android

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

如何隐藏TextView并仅在滚动时显示

我有一个ScrollView和GridView,我想在GridView上放置一个TextView,但在用户滚动到它之前一定不能看到它.我想到了负边距,但我找不到解决方案如何在负边距时使用滚动来获取此视图.

所以基本上:唯一看到的应该是gridView,但是当用户位于gridView之上并且拉起时,他应该看到一个TextView.

编辑:这一点的重点在于我想要从中进行拉动式刷新.我不想在互联网图书馆中使用流行版,因为它不能按我想要的方式使用.

编辑2:

我得到了答案,但这并不是我试图实现的目标.我想平滑地显示隐藏的TextView(就像在pull-to-refresh解决方案中一样)和setVisibility使它快速且没有任何smoothnes.这是我的代码:

XML:

<com.tas.android.quick.ui.controls.LockableScrollView
        android:id="@+id/scrollView"
        android:fillViewport="true"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <TextView 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/pullText"
                android:text="some text" />

            <com.tas.android.quick.ui.controls.ExpandableGridView
                android:id="@+id/gridview"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:clipToPadding="false"
                android:drawSelectorOnTop="true"
                android:fadingEdge="none"
                android:gravity="top"
                android:horizontalSpacing="@dimen/image_grid_hspacing"
                android:listSelector="@drawable/selector_shadow"
                android:numColumns="@integer/grid_num_cols"
                android:paddingBottom="50dp"
                android:scrollbarAlwaysDrawVerticalTrack="false"
                android:scrollbars="none"
                android:scrollingCache="true"
                android:smoothScrollbar="false"
                android:stretchMode="columnWidth"
                android:verticalSpacing="@dimen/image_grid_vspacing"
                android:visibility="visible" />
        </LinearLayout>
    </com.tas.android.quick.ui.controls.LockableScrollView>
Run Code Online (Sandbox Code Playgroud)

和代码:

textview = (TextView) findViewById(R.id.pullText);
        textview.setVisibility(View.VISIBLE);

        scrollView = (LockableScrollView) findViewById(R.id.scrollView);

        scrollView.setScrollingEnabled(false);

...

gridView.setOnScrollListener(new OnScrollListener() {
                        @Override
                        public void onScrollStateChanged(AbsListView view, int scrollState) {
                            switch(scrollState) {
                            case 2: // SCROLL_STATE_FLING 
                                //hide button here
                                textview.setVisibility(View.VISIBLE); …
Run Code Online (Sandbox Code Playgroud)

android scrollview

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

如何在Vaadin的表格中点击行号?

我需要获取用户单击的行号来处理我的数据库操作.

try {
        for (int i = 1; i < dbManager.getLastTopicId() + 1; i++) {

            Integer itemId = new Integer(i);
            String topicTitle = dbManager.getTitle(Integer.toString(i));
            String topicText = dbManager.getText(Integer.toString(i));
            String topicAuthor = dbManager.getAuthor(Integer.toString(i));

            topicList.addItem(new Object[] {topicTitle, topicText, topicAuthor},
                    itemId);
        }
    } catch (UnsupportedOperationException e) {
        e.printStackTrace();
    } catch (SQLException e) {
        e.printStackTrace();
    }
Run Code Online (Sandbox Code Playgroud)

这里我将数据加载到topicList表.我还用来topicList.addValueChangeListener(new Property.ValueChangeListener() { public void valueChange(ValueChangeEvent event) 处理用户点击.但是我需要从那个Listener获取,用户点击了哪个行号.我已经尝试了topicList.getValue(),但是没有他们给我回行号.谢谢

vaadin

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

等待互联网连接在Android中发送数据

当互联网可用且应用已经关闭时,是否有可能发送数据?假设我有app必须发送一些数据,但用户没有互联网连接.他关闭了应用程序,之后他打开了wifi.现在我想发送以前等待发送的数据.我能以某种方式做到吗?

android

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