android-intent

Android: NullPointerException error

冷暖自知 提交于 2019-12-24 11:44:39
问题 I know it is dull to ask answers for a NullPointerException, and there are similar questions out there. However, I just cannot find a solution for my problem from the other questions. I have 2 classes: CreateContactActivityl.java: Passes intent of a text output to RegexOCR1.java RegexOCR1.java: Receives the text output, pass text output into a method that is within this class The error occurs in RegexOCR1.java as stated by the logcat: Fatal Exception: java.lang.RuntimeException: Unable to

Java Android passing data Array double

一世执手 提交于 2019-12-24 10:58:52
问题 I have a question about intent in android application i have an array in class1 double [][] tableCityPair = new double[100][100]; ---here code to fill array--- in the end of class i want to send tableCityPair to another class, class2 . how i should declare for array in class2 ? is this right? Intent it = getIntent(); double tabelJarakAntarKota= it.getDoubleExtra("tableCityPair",3); 回答1: The Bundle class has methods for passing and retrieving an array of double s: void putDoubleArray(String,

Android Loading Image from URL in ListView

冷暖自知 提交于 2019-12-24 10:57:46
问题 I am Reading imageURL's From Rss Xml file and displaying in List View,I'm able to display the images ,but getting Exception For Some Image URL's java.io.FileNotFoundException Here My Code: public class ImageLoader { MemoryCache memoryCache=new MemoryCache(); FileCache fileCache; private Map<ImageView, String> imageViews=Collections.synchronizedMap(new WeakHashMap<ImageView, String>()); ExecutorService executorService; String type; public ImageLoader(Context context,String type){ fileCache=new

How to launch user's default mail client, default window(inbox)

╄→гoц情女王★ 提交于 2019-12-24 10:28:56
问题 Well I want to redirect user from app to default mail client in his phone. I heard that i can't just make intent that launch mailing app. So the general idea is to get possible applications for Intent.Action_Send, and just start one that user picked with Intent.CreateChooser(...);. But it seems that i can't or i don't know how to get picked package name. 回答1: In fact it is possible to launch the Mail client per Intent: Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com

startActivity(intent) and resume to main activity?

℡╲_俬逩灬. 提交于 2019-12-24 10:28:31
问题 I've got an app that creates an intent for the last.fm android app in which it will start the "recommended" station for my account when i press a button. The trick i'm trying to figure out is how do i get the phone back to my app without the user having to navigate back manually? Once it start the last.fm intent it takes you to the playlist and i need it to resume back to my app automatically. 回答1: If you use startActivity(intent), you cannot. Alternatively, you can use startActivityForResult

Android application loses state after launching another intent

只愿长相守 提交于 2019-12-24 09:49:22
问题 So I have the following: A Common class that many of my Activities access in my android application, via setting the class in my manifest: <application android:name="com.dev.games.phraseparty.Common"... /> Now, within this class I have several objects that are constructed to preserve application state and common services to perform applications that are constructed in the Common constructor ie GameStateVO gameState; public Common() { gameState = new GameStateVO(); } My problem is that my

Xamarin.Forms Android FileProvider: GrantWriteUriPermission not always working

一笑奈何 提交于 2019-12-24 09:43:06
问题 I want to edit files from the internal storage of my Xamarin.Forms Android app in third party apps, for example fill out form elements in a PDF file or edit a .docx file. With my implementation the file gets correctly opened in the external app, but in certain apps it is opened read-only . Adobe Acrobat and Microsoft Word open the files read-only, while other apps like Google Docs are able to write back into the file. (I am using Microsoft Word with a valid Office365 subscription). My

How to add images within texts that stored in sqlite in android

廉价感情. 提交于 2019-12-24 09:42:33
问题 I want to add some images between the texts. I stored texts in sqlite db. How can I determine the right location of images in texts. For example, I have 5 paragraphs in one lesson that I stored all those paragraphs in one cell of a row in db named body_of_lesson. Now I want to add an image after line 3 of first paragraph and 1 image after second paragraph. How can I determine these locations and add images into the locations? In other lessons might be vary the locations. I saved texts as HTML

I can't get a startService working from my BroadcastReceiver

守給你的承諾、 提交于 2019-12-24 09:32:52
问题 I am trying to start my Service when an alarm gets triggered from my BroadcastReceiver. I am not getting any error and the code runs, but its not starting my service and I am not getting any errors. Could it be a problem that is in my Service or in the manifest? I have noticed that I am often getting problems when it comes to Intents and Contexts. I have tried to read up on it, but I can't find a site that explains it in a good way though. Any suggestions? public class Alarm extends

Android : onActivityResult doesn't work on TabHost ?

自闭症网瘾萝莉.ら 提交于 2019-12-24 09:27:55
问题 I have a problem with calling onActivityResult. When I call startActivityForResult on normal Activity(with, onActivityResult works. I mean, starting application with FirstActivity, Intent intent1 = new Intent(FirstActivity.this, SecondActivity.class); startActivityForResult(intent1, CODE); works well. However, starting application with TabActivity, Intent intent2 = new Intent(this, FirstActivity.class); mTabHost.addTab(mTabHost .newTabSpec("tabmenu") .setIndicator("menu1") .setContent(intent2