android-intent

Start activity from another package - Issue

这一生的挚爱 提交于 2019-12-24 20:13:27
问题 I downloaded library project from github and imported it into my app project.The problem is that i want to start activity from this library in my main app class.I tried many ways and one of them was: Intent intent = new Intent(); intent.setComponent(new ComponentName( "com.tehedligmail.restorancafeler.RestaurantActivity , "com.cunoraz.pickImages.MainActivity"));" startActivity(intent); This is my log: 08-29 04:40:13.937: E/AndroidRuntime(11778): android.content.ActivityNotFoundException:

Problems passing integer and serializable on bundle

主宰稳场 提交于 2019-12-24 20:09:21
问题 I'm trying to pass a serializable and an Integer or a String but on my child activity I only get the serializable Parent Activity Intent intent = new Intent(Class1.this, Class2.class); Bundle bundle = new Bundle(); bundle.putInt("key", 23); bundle.putSerializable(serializable, object); intent.putExtras(bundle); startActivityForResult(intent, 1); Child Activity Intent intent = getIntent(); int intKey; Bundle bundle = intent.getExtras(); object = (Object) bundle.getSerializable(serializable);

Android AlarmClock causing force close

我们两清 提交于 2019-12-24 19:33:56
问题 I'm writing an app that sets an alarm, and here's the relevant code that's causing a force close: Intent i = new Intent(AlarmClock.ACTION_SET_ALARM); i.putExtra(AlarmClock.EXTRA_HOUR, hours); i.putExtra(AlarmClock.EXTRA_MINUTES, minutes); i.putExtra(AlarmClock.EXTRA_SKIP_UI, true); startActivity(i); The startActivity(i) is causing the force close. I tried catching ActivityNotFoundException and displaying a Toast, but the force close is still happening. I'm really new to Android programming,

Unable to launch app from web browser

戏子无情 提交于 2019-12-24 19:24:40
问题 I'm trying to launch my app as stated here: Launch custom android application from android browser I've created intent-filter in my manifest: <activity android:name=".ui.BaseActivity" android:label="@string/app_name" android:launchMode="singleTop" android:configChanges="orientation|keyboard|keyboardHidden|screenSize"> <intent-filter> <data android:scheme="http" android:host="somesite.com"/> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category

Android device time set to 6th January 1980 [closed]

前提是你 提交于 2019-12-24 19:24:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have a Huawei Ideos android phone. Sometimes the clock is set to 6th January 1980 automatically. I have tried to reproduce this issue by trying the following cases : 1) Discharging the phone battery completely. 2) Removing the battery from phone without shutting down the mobile. 3) Doing a manual shutdown even

Android Sharing Intent

会有一股神秘感。 提交于 2019-12-24 19:12:47
问题 Is there any way I can add/list my app with other apps like facebook, gmail, whatsapp and viber in sharing intent on android .? here is the sample image 回答1: I don't how this would be done using Titanium, but in the conventional way (using Eclipse), this is how I do it in one of my apps: CODE: In your manifest XML file, add the tag as shown below. This is to be done for an Activity that will handle data shared by the user. For example, if my Activity is named Composer , then the structure

ACTION_GET_CONTENT Picking Document from Downloads returns null

微笑、不失礼 提交于 2019-12-24 19:09:45
问题 I am working on PDF pick and upload to server. Below code crashed when file picked from Downloads. And works fine if file choose from any other directory. I have tried below code on oneplus 6, and nokia 6.1 which have (android 9)Pie OS. In brief code, Intent Activity start: Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("application/pdf"); intent.addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(Intent.createChooser(intent, "Select file"), 2); In

How to set user agent for new ACTION_VIEW intent

走远了吗. 提交于 2019-12-24 19:05:42
问题 In my application I am launching a new Intent with url (browser) using the following code: Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(url)); try { context.startActivity(myIntent); } catch (ActivityNotFoundException e) { Log.e(TAG, "cannot initiate Browser", e); } Is there a way tolet the new activity to send user agent thanks -Z 回答1: One can not programmatically set (from within an app) user's browser to display a custom user-agent string. However, users can do this by hand via

Android 4.4 sdcard access new rules: about saving a file that started an activity

末鹿安然 提交于 2019-12-24 19:04:25
问题 I read that with Android 4.4 there are new rules for saving files on sdcard by apps. I have a specific case to ask about: an app (activity) A starts another app (activity) B feeding it with a file:// url, say it's a txt file (B is a text editor); the app B opens the file and edits it. Is the called app B able to save the edited content on the same file? Or will the new rules prevent it? 来源: https://stackoverflow.com/questions/24683209/android-4-4-sdcard-access-new-rules-about-saving-a-file

Android Messaging, Email app behavior when starting app from a link

你说的曾经没有我的故事 提交于 2019-12-24 18:51:36
问题 I am working on the capability of starting an app via an SMS link or an email. It is all working fine. Custom links don't parse on Android phones, but that is another story. My http style link works great. But the issue is the behavior of apps like Messaging, Android GMail App, Android Mail app, Android Outlook app, Whatsapp, etc. ( Here is the scenario: Go to app, like Messaging, Gmail, etc. Click on the link to start up my app (app starts up correctly) Hit the Home Button Hit the icon of