Tag: android manifest

你怎么能从应用程序的(布局)XMLvariables获得清单版本号?

我想要在代码的主要部分中引用项目的清单版本号。 到目前为止,我一直在做的是将String XML文件中的版本号链接到清单(@ string / Version)。 我想要做的是反过来,将一个stringXMLvariables链接到清单中的版本。 原因? 我只想更改一个位置的版本号,清单文件。 有没有办法做到这一点? 谢谢!

如何更改Android应用程序的名称?

有没有办法改变一个应用程序的名称,而无需创build一个新的项目? 示例:在我的应用程序所在的主页上,我有一个图标和名称Foo,但是我想将名称更改为Bar。 我可以这样做吗?

错误types3错误:活动类{}不存在

我有一个INTELIJ(V12)Android项目成功导入到AndroidStudio(V0.4.0)。 如果我不在manifest中改变任何东西的话,它是完美的。 当我想更改启动器活动并运行时,它会输出以下错误: Launching application: com.trackingeng/LandingActivity. DEVICE SHELL COMMAND: am start -D -n "com.trackingeng/LandingActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.trackingeng/LandingActivity } Error type 3 Error: Activity class {com.trackingeng/LandingActivity} does not exist. 当我点击同步项目与Gradle文件输出: Project Sync The project 'TrackingEng' is not a Gradle-based project 任何人都面临这个问题? 有任何想法吗? 运行设置:

如何在我的情况下以编程方式显示一个布局?

我的主要布局main.xml只包含两个LinearLayouts: 第一个LinearLayout包含一个VideoView和一个Button , 第二个LinearLayout拥有一个EditText ,这个LinearLayout已经将可见性值设置为“ GONE ”( android:visibility="gone" ) 如下所示: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/first_ll" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <VideoView android:id="@+id/my_video" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="9" /> <Button android:id="@+id/my_btn" android:layout_width="30dip" android:layout_height="30dip" android:layout_gravity="right|bottom" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:id="@+id/second_ll" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingTop="2dip" android:visibility="gone" > <EditText android:id="@+id/edit_text_field" android:layout_height="40dip" android:layout_width="fill_parent" android:layout_weight="5" android:layout_gravity="center_vertical" /> </LinearLayout> </LinearLayout> 我成功实现了这个function,当Button (带有id my_btn)被按下时,带有EditText字段的第二个 […]

android.content.ActivityNotFoundException:

当我试图从另一个调用一个活动时,我得到这个exception。 完全的例外是 android.content.ActivityNotFoundException:无法find显式的活动类{com.xy / com.xyclass}; 我正在做一个intent.setClass("com.xy","com.xyclassName")其中className是我的活动类的名称和com.xy是它所在的包。 我的AndroidManifest.xml包含以下内容: <activity android:name="com.xyclassName" android:label="@string/app_name"> 我错过了什么?

如何在Android中使用自定义权限?

我有两个应用程序。 一个是声明权限和单个Activity : AndroidManifest.xml的一部分 <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:permission="your.namespace.permission.TEST" > <activity android:name=".DeclaringPermissionActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="myapp" android:host="myapp.mycompany.com" /> </intent-filter> </activity> </application> 第二个声明是使用权限 AndroidManifest.xml的一部分 <uses-sdk android:minSdkVersion="10" /> <uses-permission android:name="your.namespace.permission.TEST" /> <application 部分Activity : public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); […]

Android权限在API 23中的正常权限和危险权限列表?

在API 23的运行时需要哪些权限请求权限?

包括Google Play服务库时,为什么权限会自动添加到我的AndroidManifest中

我注意到,当我在build.gradle文件中使用以下权限时,会自动添加以下权限 compile 'com.google.android.gms:play-services:7.5.0' 这与早期版本的播放服务没有发生。 有没有人有一个解决scheme来删除这些不需要的权限? 我只使用广告function(INTERNET和ACCESSNETWORK_STATE)。 我不需要LOCATION和USE_CREDENTIALS权限。 你如何删除这些不需要的权限? 我注意到'manifest-merger-xxx-debug-report.txt'文件包含以下内容 …<snipped bunch of other merges> MERGED from com.google.android.gms:play-services-maps:7.5.0:22:5 android:name ADDED from com.google.android.gms:play-services-maps:7.5.0:22:22 uses-permission#android.permission.ACCESS_COARSE_LOCATION ADDED from com.google.android.gms:play-services-maps:7.5.0:23:5 MERGED from com.google.android.gms:play-services-maps:7.5.0:23:5 MERGED from com.google.android.gms:play-services-maps:7.5.0:23:5 MERGED from com.google.android.gms:play-services-maps:7.5.0:23:5 android:name ADDED from com.google.android.gms:play-services-maps:7.5.0:23:22 uses-feature#0x00020000 ADDED from com.google.android.gms:play-services-maps:7.5.0:24:5 MERGED from com.google.android.gms:play-services-maps:7.5.0:24:5 MERGED from com.google.android.gms:play-services-maps:7.5.0:24:5 MERGED from com.google.android.gms:play-services-maps:7.5.0:24:5 android:glEsVersion ADDED from com.google.android.gms:play-services-maps:7.5.0:25:8 […]

如何从APK文件查看AndroidManifest.xml?

有没有可能查看Androidmanifest.xml文件? 我只是将apk文件的扩展名更改为zip 。 这个zip文件包含Androidmanifest.xml文件。 但是我无法查看Androidmanifest.xml的内容。 它是完全encryption的。 我如何查看Androidmanifest.xml文件?

如何为启动程序设置不同的标签而不是活动标题?

这个问题之前已经被问过了,但是根本没有令人满意的答案! 所以我再试一次。 我想给我的应用程序启动器图标(在启动屏幕上显示的那个图标!)一个不同的,更短的标题。 看起来发射器从mainfest部分关于主要活动的标签采取标签,如下所示: <activity android:name="MainActivity" android:label="@string/app_short_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> 我已经改变了原来的引用到我的应用程序的名称@string/应用程序名称在这里不同,更短的string资源。 但是 – 大但是 :这当然也改变这个活动的默认标题! 我不希望这样的事情发生,有足够的空间来申请一个长的应用程序名称! 使用setTitle(int)方法在onCreate再次设置长标题也是不好的,因为短名称在短时间内对用户是可见的,但是长到足以注意到! 而且 – 请不要通过引用自定义标题栏来回答我的问题…我不想走很长的路,只是因为一个愚蠢的string标题! 绘制一个自定义标题栏,这是一个很痛苦的影响! 有没有简单的方法给发射器一个不同的string显示? 感谢您的回答! 编辑:为什么有一个自定义的标题栏的另一个原因是,它不会看起来像默认的标题栏,我将不得不明确做的事情,使它看起来在每个设备上相似! 如果毕竟,我不想要一个不同的外观,这不可能是一个解决scheme!