本篇文章给大家谈谈Android–在我的应用程序中获取电子邮件附件名称,以及获取电子邮件地址的知识点,同时本文还将给你拓展AndroidActionBar/工具栏消失在我的应用程序中、android–
本篇文章给大家谈谈Android – 在我的应用程序中获取电子邮件附件名称,以及获取电子邮件地址的知识点,同时本文还将给你拓展Android ActionBar /工具栏消失在我的应用程序中、android – 不要在最近的应用程序中显示我的应用程序、android – 从我的应用程序打开电子邮件应用、android – 在发布我的应用程序之前获取play.google上我的应用程序的链接等相关知识,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:- Android – 在我的应用程序中获取电子邮件附件名称(获取电子邮件地址)
- Android ActionBar /工具栏消失在我的应用程序中
- android – 不要在最近的应用程序中显示我的应用程序
- android – 从我的应用程序打开电子邮件应用
- android – 在发布我的应用程序之前获取play.google上我的应用程序的链接
Android – 在我的应用程序中获取电子邮件附件名称(获取电子邮件地址)
以下是我的intent过滤器的样子:
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/jpeg" /> </intent-filter>
这是我得到的:
INFO/ActivityManager(97): Starting:
Intent {
act=android.intent.action.VIEW
dat=content://gmail-ls/messages/john.doe%40gmail.com/42/attachments/0.1/SIMPLE/false
typ=image/jpeg flg=0x3880001
cmp=com.myapp/.ui.email.EmailDocumentActivityJpeg
} from pid 97
在我的活动中,我得到了Uri并使用它来获取文件内容的输入流:
InputStream is = context.getContentResolver().openInputStream(uri);
在这种情况下,我在哪里可以找到文件名?
解决方法
主要思想是,您获得的URI既可用于检索文件内容,也可用于查询以获取更多信息.
我做了一个快速实用程序函数来检索名称:
public static String getContentName(ContentResolver resolver,Uri uri){ Cursor cursor = resolver.query(uri,null,null); cursor.movetoFirst(); int nameIndex = cursor.getColumnIndex(MediaStore.MediaColumns.disPLAY_NAME); if (nameIndex >= 0) { return cursor.getString(nameIndex); } else { return null; } }
您可以在活动中以这种方式使用它:
Uri uri = getIntent().getData(); String name = getContentName(getContentResolver(),uri);
这对我有用(检索PDF文件的名称).
Android ActionBar /工具栏消失在我的应用程序中
所以我有一个应用程序.目前有3个活动…我正在用意图从另一个活动中启动活动
MainActivity > ChallongeLogin > ChallongeEvents
在我的MainActivity和ChallongeLogin中,应用程序顶部有一个大栏,列出了我的应用程序名称.但是,当我最终阅读ChallongeEvents时,该条消失了……我不记得做任何特别的事情使该条消失了.为什么消失了?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testing.testingapp">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:screenorientation="portrait"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:screenorientation="portrait"
android:name=".ChallongeLogin" />
<activity
android:screenorientation="portrait"
android:name=".ChallongeEvents" />
</application>
</manifest>
解决方法:
根据您的要求,您必须扩展AppCompatActivity而不是Activity.
public class ActivityName extends AppCompatActivity {
// ...
}
AppCompatActivity is from the appcompat-v7 library. Principally, this
offers a backport of the action bar. Since the native action bar was
added in API Level 11, you do not need AppCompatActivity for that.
However, current versions of appcompat-v7 also add a limited backport
of the Material Design aesthetic, in terms of the action bar and
varIoUs widgets. There are pros and cons of using appcompat-v7, well
beyond the scope of this specific Stack Overflow answer.
参考
07001
android – 不要在最近的应用程序中显示我的应用程序
我的目的是:
user禁用运行我的应用程序
我很抱歉发言不好.
解决方法
对于你的每个活动android:excludeFromrecents =“true”
<activity android:name=".Activity" android:excludeFromrecents="true" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
有关更多信息,请参阅此doc
android – 从我的应用程序打开电子邮件应用
如何从我的应用程序打开电子邮件应用程序.我想直接启动撰写电子邮件屏幕,其中包含用户应通过电子邮件发送的电子邮件ID.我想做类似于电脑上发生的事情.如果单击电子邮件地址,系统将自动打开具有撰写屏幕的电子邮件客户端.撰写屏幕将包含电子邮件ID.
Intent intent = Intent.parseUri("mailto:bob@test.com",Intent.URI_INTENT_SCHEME);
startActivity(intent);
android – 在发布我的应用程序之前获取play.google上我的应用程序的链接
解决方法
https://play.google.com/store/apps/details?id=<your package name>
你可以通过这种方式获得包名.
String packageName = getApplicationContext().getPackageName();
目前它不会显示任何应用程序,但在发布后会自动重定向到您的应用页面.
我们今天的关于Android – 在我的应用程序中获取电子邮件附件名称和获取电子邮件地址的分享已经告一段落,感谢您的关注,如果您想了解更多关于Android ActionBar /工具栏消失在我的应用程序中、android – 不要在最近的应用程序中显示我的应用程序、android – 从我的应用程序打开电子邮件应用、android – 在发布我的应用程序之前获取play.google上我的应用程序的链接的相关信息,请在本站查询。
本文标签: