Questions tagged «android»

Android是Google的移动操作系统,用于对数字设备(智能手机,平板电脑,汽车,电视,Wear,Glass和IoT)进行编程或开发。对于与Android相关的主题,请使用特定于Android的标签,例如android-intent,android-activity,android-adapter等。对于与开发或编程无关但与Android框架相关的问题,请使用以下链接:https:// android.stackexchange.com。

7
导入android.support.v7无法解析
我是Android新手。目前,我已adt-bundle-windows-x86-20131030.zip安装(Windows 32位)-并成功安装了Android SDK和Eclipse。另外,我还更新了Android SDK管理器中的所有内容。现在,我正在使用Android v-4.4.2 我的项目成功运行,但是当我导入时android.support.v7.app.ActionBarActivity;,import android.support.v7.app.ActionBar;该项目将无法调试。我得到错误The Import android.support.v7 cannot be resolved 我在Google中搜索并安装,Android Support Library然后将其添加v7到我的项目中。 文件->导入(android-sdk \ extras \ android \ support \ v7)。选择“ appcompat” 项目->属性-> Android。在“添加”部分库中,选择“ appCompat” 屏幕截图 已成功添加,appCompat但仍然出现错误。
77 android  eclipse 

7
在新的嵌套片段API中未调用onActivityResult()
我一直在使用Android支持库中包含的新的嵌套片段API。 嵌套片段所面临的问题是,如果调用了一个嵌套片段(即,已通过的FragmentManagerreturn由添加到另一个片段的片段getChildFragmentManager())startActivityForResult(),onActivityResult()则不会调用该嵌套片段的方法。但是,父片段onActivityResult()和活动onActivityResult()都被调用。 我不知道是否缺少有关嵌套片段的信息,但是我没有想到所描述的行为。下面是重现此问题的代码。如果有人能指出正确的方向并向我解释我做错了什么,我将不胜感激: package com.example.nestedfragmentactivityresult; import android.media.RingtoneManager; import android.os.Bundle; import android.content.Intent; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Toast; public class MainActivity extends FragmentActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.getSupportFragmentManager() .beginTransaction() .add(android.R.id.content, new ContainerFragment()) .commit(); } public void onActivityResult(int requestCode, int resultCode, …

8
'android-24'需要JDK 1.8或更高版本进行编译
我使用Android Studio,最近收到错误消息: 错误:任务':app:compileDebugJavaWithJavac'的执行失败。compileSdkVersion'android-24'需要JDK 1.8或更高版本进行编译。 但是我已经安装了JDK 1.8: :\ Users ..> java -version Java版本“ 1.8.0_91” Java(TM)SE运行时 环境(内部版本1.8.0_91-b15)Java HotSpot(TM)64位服务器VM (内部版本25.91-b15,混合模式) 如何解决?谢谢


10
Android eclipse DDMS-无法访问手机上的数据/数据/来提取文件
在测试我的应用程序时,我使用模拟器和自己的手机查看一切是否正常。我的应用程序还在将数据写入共享的首选项和文本文件。 我可以通过DDMSeclipse从模拟器中提取数据,以便读取计算机上的数据文件,但是当我尝试通过DDMS手机上的文件夹打开这些文件夹时,什么也没发生。我单击数据文件夹,但没有任何反应。 我的手机已扎根。有什么办法可以从手机中提取文件?我知道Android会将这些文件夹设为私有,但是必须有一种方法。该模拟器就是这样太慢了。
77 android  eclipse 

2
如何在另一个应用程序中启动活动?
我的应用程序A定义如下: <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name="com.example.MyExampleActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> 现在在应用程序B中,如何编写代码以启动应用程序A中的活动?谢谢!




8
撇号前面没有\
我在android应用程序中定义了一个字符串: <string name="search_occurs">'{string}' occurs {times}</string> 这给出了错误:撇号不以\开头(在“ {string}”中发生{times}) 我尝试了很多方法来解决此问题: <string name="search_occurs">\'{string}\' occurs {times}</string> <string name="search_occurs">'{string}' occurs {times}</string> <string name="search_occurs"><![CDATA['{string}' occurs {times}]]></string> <string name="search_occurs"><![CDATA[\'{string}\' occurs {times}]]></string> 我无法摆脱错误。我想念什么?


5
无头Linux上的“ android update sdk”
有没有人成功在无头Linux服务器上更新/安装Android SDK平台?我得到的只是以下错误: 似乎实际上不支持动作“ update sdk”? ~/android-sdk-linux_86/tools$ ./android --verbose update sdk No command line parameters provided, launching UI. See 'android --help' for operations from the command line. Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3550 or swt-pi-gtk in swt.library.path, java.library.path or the jar file at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown …
77 android 

2
Android视图生命周期是否有任何图形表示(状态图)?[关闭]
关闭。此问题不符合堆栈溢出准则。它当前不接受答案。 想改善这个问题吗?更新问题,使其成为Stack Overflow的主题。 3年前关闭。 改善这个问题 我们都知道Android Activity的生命周期和Fragment的生命周期。但是视图有什么等效的东西吗? 例如,这可以帮助建立自定义视图或深入了解Android上非常常见且经常隐藏的图形操作。 提前致谢 !

10
Gradle发出错误“无法创建类型为'AppPlugin'的插件”
我正在尝试使用gradle创建一个简单的android项目。我在使用Debian GNU / Linux 7'wheezy'的计算机上工作。 我遵循了Gradle插件用户指南-Android Tools Project网站中的建议,但会引发错误: FAILURE: Build failed with an exception. * Where: Build file '/home/alex/Proyectos/MyLogin/build.gradle' line: 11 * What went wrong: A problem occurred evaluating root project 'MyLogin'. > Could not create plugin of type 'AppPlugin'. * Try: Run with --stacktrace option to get the stack …
77 android  gradle 

9
如何禁用视图后单击事件Framelayout
在这里,我有一个视图寻呼机活动,其中有一个imageview和2个叠加条。那里我使用android xml文件布局本身制作的覆盖栏。 这是我的要求 1)第一次单击查看传呼器的imageview =显示顶部和底部矩形叠加条。2)第二次点击查看寻呼机的imageview =隐藏这些覆盖。 这些都是像android gallary view type这样的函数。 但是在这里,当这些顶部和底部布局栏当时显示时,我只想使用按钮,请单击仅在此布局中声明了哪些按钮。 但是我没有成功实现这一目标。 问题 1)什么时候top or bottom bar我可以点击next or previous按钮,而不是它的takes事件背后的imageview单点触摸事件,而我的栏变得不可见了。2)仅希望声明按钮事件3)避免在我触摸覆盖栏时单击imageview。 简而言之,当那时我的顶部和底部图像栏出现时,不会从顶部和底部图像栏发生touh事件。当我单击下一个或上一个或共享按钮时,我可以单击imageview但不能单击。 这些就是我面临的问题,请帮助我。 源代码 : activity_pager_image.xml <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <RelativeLayout android:id="@+id/rl_top_overlay" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/slideshow_bar" android:visibility="gone" > <TextView android:id="@+id/tv_top_overlay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.