小编And*_*ebe的帖子

为什么我收到错误消息"URI未注册"?


我刚刚安装了Android Studio,一切运行正常,但是在我的计算机关闭后我第二次打开了AS,我收到以下错误:

"URI is not Registered"
Run Code Online (Sandbox Code Playgroud)

在以下代码行中:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
Run Code Online (Sandbox Code Playgroud)

这只是清单,但它在所有带有该链接的XML文件上发生.我搜索过Stack并没有找到解决我问题的方法.

android

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

将导航抽屉放在状态栏下

我正在尝试让我的导航抽屉进入状态栏.我已经阅读了很多关于ScrimInsetsFrameLayout视图的内容,我尝试实现它,但由于某种原因它不会被删除.

这是我使用/编写的代码.

XML DrawerLayout:

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

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

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

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

    </FrameLayout>

    <com.andrewq.planets.util.ScrimInsetsFrameLayout
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/linearLayout"
        android:layout_width="304dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:insetForeground="#4000">

        <ListView
            android:id="@+id/left_drawer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:choiceMode="singleChoice" />
    </com.andrewq.planets.util.ScrimInsetsFrameLayout>


</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)

ScrimInsetsFrameLayout.java:

package com.andrewq.planets.util;

/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License …
Run Code Online (Sandbox Code Playgroud)

android

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

无法为Linux amd64加载本机库'libnative-platform.so'

首先,如果这属于Ask Ubuntu,我很抱歉......我不确定这个论坛是什么.

我正在尝试使用PHP和shell脚本从Github派生并构建一个Android项目.基本上,我是从我写入网站的shell脚本中打印出一些输出.当您访问该页面并按下某些按钮时,该项目将使用Gradle进行分叉和构建.PHP代码运行shell脚本,然后在命令运行时将输出打印到浏览器中.

但是,我收到此错误作为我的脚本的输出:

FAILURE: Build failed with an exception.

* What went wrong:
Failed to load native library 'libnative-platform.so' for Linux amd64.
Run Code Online (Sandbox Code Playgroud)

该脚本现在只是运行gradle build但我打算稍后更改...现在,我正在构建根项目并输出结果.

如果我使用--stacktrace标志运行命令,这是输出:

* Exception is:
net.rubygrapefruit.platform.NativeException: Failed to load native library 'libnative-platform.so' for Linux amd64.
    at net.rubygrapefruit.platform.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:49)
    at net.rubygrapefruit.platform.Native.init(Native.java:55)
    at org.gradle.internal.nativeintegration.services.NativeServices.initialize(NativeServices.java:74)
    at org.gradle.internal.nativeintegration.services.NativeServices.initialize(NativeServices.java:60)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:203)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: …
Run Code Online (Sandbox Code Playgroud)

php shell ubuntu android gradle

14
推荐指数
2
解决办法
7993
查看次数

在android中的按钮上隐藏文字?

请告诉我如何在android中的按钮上隐藏文本.

当我尝试这个代码时,按钮被隐藏但我只想隐藏按钮上的文本.

Button b= (Button)findViewById(R.id.follow);
b.setVisibility(View.GONE);
Run Code Online (Sandbox Code Playgroud)

请告诉我如何解决这个问题.

谢谢.

java android

9
推荐指数
2
解决办法
6753
查看次数

aapt.exe问题

我正在使用Android开发者网站上下载的最新版本的ADT Bundle.我在Windows 7上.由于我从Windows收到以下崩溃消息,我的R.java文件无法正确编译:

错误信息

这是问题详细输出:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: aapt.exe
  Application Version:  0.0.0.0
  Application Timestamp:    52684cb5
  Fault Module Name:    aapt.exe
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp:   52684cb5
  Exception Code:   c0000005
  Exception Offset: 0003cf2a
  OS Version:   6.1.7601.2.1.0.256.1
  Locale ID:    1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt …
Run Code Online (Sandbox Code Playgroud)

java eclipse android r.java-file

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

SecurityException:使用应用内结算将Binder调用到错误的界面

尝试使用Google提供的应用内结算库时,我收到了SecurityException.以下是完整的例外情况:

07-05 15:56:47.783  26481-26481/com.andrewq.planets E/AndroidRuntime? FATAL EXCEPTION: main
    Process: com.andrewq.planets, PID: 26481
    java.lang.SecurityException: Binder invocation to an incorrect interface
            at android.os.Parcel.readException(Parcel.java:1465)
            at android.os.Parcel.readException(Parcel.java:1419)
            at billing.IInAppBillingService$Stub$Proxy.isBillingSupported(IInAppBillingService.java:208)
            at com.android.vending.billing.IabHelper$1.onServiceConnected(IabHelper.java:227)
            at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1101)
            at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1118)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)

这是带有第227行的IabHelper.java方法:

    @Override
    public void onServiceConnected(ComponentName name, IBinder service) {
        if (mDisposed) return;
        logDebug("Billing service connected.");
        mService = IInAppBillingService.Stub.asInterface(service);
        String packageName = mContext.getPackageName();
        try {
            logDebug("Checking for in-app billing 3 …
Run Code Online (Sandbox Code Playgroud)

android

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

Android 开发的 Macbook Air 硬件要求?

我想购买 Macbook Air 2013 用于 Android 和 J2EE 开发,但 Macbook Air 规格是 i5 处理器、4GB 内存和 128GB SSD。所以我的问题是:这对于开发来说是否足够好?

android

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

ImageViews和意图

因此,当点击图像时,我正在尝试启动新活动,该图像将以全屏图像开始新活动.为此,我编写了以下代码:

在XML文件中定义的ImageView:

<ImageView
     android:id="@+id/sun"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_below="@+id/sun_title"
     android:layout_centerHorizontal="true"
     android:contentDescription="@string/sun_image"
     android:src="@drawable/sun" />
Run Code Online (Sandbox Code Playgroud)

这是我在单击图像时使用onClickListener来处理意图的地方:

ImageView imageView;
//begin onViewCreated Method
     ...

     final Context classContext = null;
     imageView = (ImageView) getView().findViewById(R.id.sun);

     imageView.setOnClickListener(new View.OnClickListener() {

          @Override
          public void onClick(View v) {
               Intent i = new Intent(classContext, Settings.class);
               startActivity(i);                
          }
     });

     ...
//end onViewCreated Method
Run Code Online (Sandbox Code Playgroud)

我使用以下代码没有错误,但是当我运行应用程序并点击图像时,应用程序崩溃并返回nullPointerException.这是logcat:

02-25 16:55:43.201: E/AndroidRuntime(3459): FATAL EXCEPTION: main
02-25 16:55:43.201: E/AndroidRuntime(3459): Process: com.andrewq.planets, PID: 3459
02-25 16:55:43.201: E/AndroidRuntime(3459): java.lang.NullPointerException
02-25 16:55:43.201: E/AndroidRuntime(3459):     at android.content.ComponentName.<init>(ComponentName.java:77)
02-25 16:55:43.201: E/AndroidRuntime(3459):     at android.content.Intent.<init>(Intent.java:3821)
02-25 16:55:43.201: E/AndroidRuntime(3459): …
Run Code Online (Sandbox Code Playgroud)

java eclipse android listview android-intent

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

在片段中使用InputMethodManager

我正在尝试使用搜索栏,以便用户可以调整片段中edittext框的值。这是我使用它的地方:

...

//NOTE: This is in the onCreateView() method for a Fragment
button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
         seekBar.setProgress(seekBar.getProgress() + 1);
         editText.setText(String.valueOf(seekBar.getProgress()));

         //Hidden method call not needed to be visible...

         //Notice the InputMethodManager, also, this is line 197...
         InputMethodManager imm = (InputMethodManager) context.getSystemService(                                    
              Context.INPUT_METHOD_SERVICE);

         imm.hideSoftInputFromWindow(seekBar.getWindowToken(), 0);

    }
});

...
Run Code Online (Sandbox Code Playgroud)

这是Logcat的输出:

03-09 00:00:41.164      573-573/com.hidden.hidden E/AndroidRuntime? FATAL EXCEPTION: main
    java.lang.NullPointerException
            at com.hidden.hidden.hidden.onClick(Hidden.java:197)
            at android.view.View.performClick(View.java:3480)
            at android.view.View$PerformClick.run(View.java:13983)
            at android.os.Handler.handleCallback(Handler.java:605)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4340)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511) …
Run Code Online (Sandbox Code Playgroud)

android android-fragments

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