android-intent

How to open a file in Android via an Intent

橙三吉。 提交于 2019-12-23 06:54:13
问题 how can I open a file that has been previously stored in the "privat" filesystem? The file is being downloaded by a webservice and should be stored on local fs. I got a "strange" error when trying to open the file via an Intent (Action_View). Although the file is present in the filesystem (saw the file in the file explorer in emulator/eclipse) it won't be shown in the calling galery activity that is launched. Instead of the picture the galery shows a black screen with not content in there

Android: i want to create code very secure [closed]

≡放荡痞女 提交于 2019-12-23 06:42:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . My question is to develop one application in android, so meanwhile I want to create well secure code, I'm uploading APK in play store how to obfuscates my code using a Proguard, I need to obfuscate class names, libraries, id and basic functionalities in the Proguard. Please help

Android: i want to create code very secure [closed]

不问归期 提交于 2019-12-23 06:42:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . My question is to develop one application in android, so meanwhile I want to create well secure code, I'm uploading APK in play store how to obfuscates my code using a Proguard, I need to obfuscate class names, libraries, id and basic functionalities in the Proguard. Please help

Android Share Intent

☆樱花仙子☆ 提交于 2019-12-23 06:12:58
问题 How can implement an intent for sharing some text in a dialog like this ? 回答1: Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(filePath)); try { startActivity(Intent.createChooser(intent, "Sending File...")); } 回答2: There u are: Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, YOUR_TEXT_TO_SEND); startActivity(Intent

How to pass string url from Main Activity to next Activity and load url in webView [duplicate]

江枫思渺然 提交于 2019-12-23 06:10:54
问题 This question already has answers here : How do I pass data between Activities in Android application? (53 answers) Closed last year . I have two Activity, One is Mainactivity and another is Secondactivity. Secondactivity contains Webview that loads local HTML pages from assets folder. Mainactivity contains buttons labeled as Button A and Button B when pressed would start Secondactivity. I would like to pass the string as URL from Mainactivity to Secondactivity which loads the A.html and B

Passing data from a BroadcastReceiver to MainActivity works correctly only once

六月ゝ 毕业季﹏ 提交于 2019-12-23 05:46:31
问题 I have a PushNotificationReceiver (extends BroadcastReceiver) and MainActivity . The receiver sends some data (for example string value " New value ") to the MainActivity via an Intent . Then MainActivity updates its TextView with this value. This works fine until I change this TextView value to some other value (for example reset it to " UNSPECIFIED ") and move the activity to background and to foreground again. The MainActivity is restored and its TextView contains " New value ", however I

On Android 4.2.2, Intent INSTALL_SHORTCUT creates shortcut in the second page

雨燕双飞 提交于 2019-12-23 05:44:33
问题 I get a strange result when calling this code to simply create a shortcut in the home screen. The shortcut is created on the second page of the home screen (and the first page is empty so there is enought space!). Any ideas? public static void installShortcut(Context context, String packageName, String componentName, String shortcutName, Parcelable icon) { Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); ComponentName cn = new ComponentName(packageName,

can't share image properly android

与世无争的帅哥 提交于 2019-12-23 05:38:11
问题 If i share image one time in gmail and again come back and do some changes and again if i share then only previous image was displaying :( that was the issue with 4.1.1 when i run same problem in 4.2.2 it works perfectly :( :( :( Hi i what to share image using Intent for that i have used below code public void otherBtn(View v) { FileOutputStream out = null; try { if (bitmap != null) { bitmap.recycle(); bitmap = null; } Intent sharingIntent = new Intent(Intent.ACTION_SEND); File sdcard =

How to check username and password in a PostgreSQL server from Android?

懵懂的女人 提交于 2019-12-23 05:33:16
问题 I am using the Android 2.2 API. I want to know how to connect to a PostgreSQL database server. I am new to this and so have no ideas, so please help me with some sample code. 回答1: You usually don't connect directly to a database. To achieve the results you want, you can do a RESTful request. This means, send either a JSON string or xml file to a server(which you can program in php, ruby and what not) I'm not going to give you sample code cause there are literally tons of code on a simple

Android ListView Duplicates entries

China☆狼群 提交于 2019-12-23 05:32:15
问题 If i type "Hello" in my edittext in activity 1 it will add "Hello" to the listview in activity 2 as the first entry ( which has no error ). Also, if I type "Apple" as my second entry I will change the first entry of "Hello" to "Apple" and add the new 2nd entry "Apple"... causing both entries to become "Apple" and "Apple"... any thoughts? Act2 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_argue_list);