Android :: ACTION_VIEW Exception ?
Sep 22, 2010
I try and open up a new activity, pointing to the market, with the following code:
CODE:......
It works fine on the device, but the Emulator throws an Exception:
CODE:....
I'm not sure if this is just an emulator thing, or whether this could replicate on a real device?
View 4 Replies
Nov 13, 2009
I have a folder on sd-card in which I keep photos edited in my application. Im trying to force deafult android image viewer to see all pictured in that folder. Unfortunately I am able to see only one picture. The "next" and "previous" arrows are disabled.
The code i use to see only one picture:
CODE:.....
How to activate the browsing option? how to call the intent so that every picture in that folder would be visible?
View 2 Replies
View Related
Aug 5, 2009
I have an image file on my sdcard and the path to the file is: /sdcard/apps/MyPath/1249487966270.png
When a user clicks a button on my application I want to display this image to the user. Inside of the click listener I'm using the following code:
CODE:........
The button click event happens, the activity is started and then it is ignored. Nothing appears!
Watching the log through DDMS I see the following entries:
CODE:...........
What am I doing wrong? Why am I getting "Window already focused"? I want to use the default activity for viewing the image (the camera's ViewImage class). But this is not working.
View 2 Replies
View Related
Jul 15, 2010
I execute the following code:
CODE:....................
Which opens the image viewer activity but I don't want to see the navigation arrows as well as the items in the menu. I only want the zoom controls. Is it possible to have it like that ?
View 2 Replies
View Related
Oct 9, 2009
I would like to run an ACTION_VIEW with memory data.
The first solution is to write data in a file on sdcard but ... it does not seem so efficient. I was thinking to implement my own content provider, but as far as I understand I need to return an ParcelFileDescriptor. I found a MemoryFile implementation in SDK, however I don't know how to get a ParcelFileDescriptor for a MemoryFile.
View 2 Replies
View Related
Mar 23, 2009
I have an application that needs to have a user visit a web page to authorize it. After spending time in the Browser the user should return the my application.
Currently, I'm launching the Browser with:
CODE:................
After using the browser, I can go back home and launch my application, which stacks a new Activity on top of the previous stack of Activities that were being used in the application. For example. If the user launches the app, they have Activity A in the stack. From there we navigate to Activity B which then launches the Browser. Then, the next time we enter the app, we launch Activity A, which is pushed onto the stack that already contains an A and B.
My question is then, how can I just go back to the previous stack? Basically, do I have to create a new Activity? Is there a better way to launch the Browser, and then come back to my application?
Also, I've been using the Intent.FLAG_ACTIVITY_NEW_TASK when I start the Browser activity so that my app stays running.
View 2 Replies
View Related
Jul 27, 2010
I have an application that sends messages to a specified contact. Right now I use
CODE:..............
To send messages, and it works great on the emulator and on my N1. I got complaints from users with HTC incredible that they get force close from android.mms application when they use it. I did more digging and I see there are many ways for sending messages.
For example
CODE:........
And also
CODE:....................
They all seem to work exactly the same on the emulator and on my device, and I could not find anything official about the correct, generally supported way.
View 2 Replies
View Related
Jun 2, 2010
I have an app that downloads a pdf from a server and tries to open it with an itent:
Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); File file = new File(filepath+filename); intent.setDataAndType(Uri.fromFile(file), "application/pdf"); try { startActivity(intent); } catch (ActivityNotFoundException e) {
View 2 Replies
View Related
Jul 14, 2010
I created a sql lite database with the following columns:
static final String dbName="demoDB";
static final String tableName="Employees";
static final String colID="EmployeeID";
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL("CREATE TABLE "+tableName+" ("+colID+" INTEGER PRIMARY KEY AUTOINCREMENT, "+
colName+" TEXT, "+colAge+" Integer);");
I want to select all the records in the database like this and display them in a gridview:SQLiteDatabase db=this.getWritableDatabase();Cursor cur= db.rawQuery("Select "+colName+", "+colAge+" from "+tableName, new String [] {});String [] from=new String []{DatabaseHelper.colName,DatabaseHelper.colAge};
int [] to=new int [] {R.id.colName,R.id.colAge};
SimpleCursorAdapter sca=new SimpleCursorAdapter(this,R.layout.gridrow,c,from,to);
GridView grid=(GridView)findViewById(R.id.grid);
grid.setAdapter(sca);but i receive the following exception:java.lang.IllegalArgumentException: column '_id' does not exist.the db table does not have a column with name '_id'so what is wrong with this code
View 3 Replies
View Related
Sep 2, 2010
I have a problem with a strange out of memory exception that only occurs on some devices (mostly HTC Desire). It happens there every time a user starts a certain activity (no matter how - there are two paths to that activity) and i'm really puzzled as to why (i checked for leaks and couldn't find any)...
The error is either thrown when calling setContentView or shortly after.
This is the code block that throws the error:
CODE:.........
As i said - the error is usually thrown when calling setContentView or when calling getMonthTimeStamps()
getMonthTimeStamps is a helper function which creates a list of dates available in the internal database. It creates a couple of (small objects) and returns an ArrayList.
Here is the function:
CODE:.............
I'm not claiming that my code is flawless or perfect, but i really don't understand why this error is thrown. The XML-layout doesn't contain any references to images and not very complicated (textview, spinner, tablelayout).
Here is the error log i received from one user:
CODE:.....................
View 4 Replies
View Related
Nov 22, 2010
I think the error is from this manifest file? when i want to start this activity "SearchResultForm" i have the exception?
CODE:................
View 2 Replies
View Related
Oct 30, 2010
I have next stuff:
CODE:..............
As i see in debug mode db.execSql proceeds w/o any exceptions, but then in this code:
CODE:.........
Is triggered by exception with message like 'There is no table with name "Preferences"'
View 2 Replies
View Related
May 7, 2010
Why I m getting the following exception.
CODE:...................
View 1 Replies
View Related
Aug 18, 2009
Getting a bunch of these errors logged on one of our apps... Not sure exactly whats causing it (doesn't show our app anywhere in the stacktrace)
CODE:......................
Anyone know where to start looking?
View 5 Replies
View Related
Aug 9, 2010
I read somewhere not to exception handle when developing in Android, is that true?
If one does need to exception handle are there any logging tools for 2.1 and above?
If shouldn't exception handle, why is it not recommended to at least use the below?
try {body-code} catch (exception-classname variable-name) {handler-code}
View 3 Replies
View Related
May 17, 2010
I am working on the task to search a location which stored in DB. After that i have to drop a pin on the corresponding location. I made a modification on Quick Search Box(QSB) to search the DB which is in my app. for that QSB performance i followed the Search Dictionary example in API Demos. when i click the search suggestion it reloads the current activity and drop the pin on it. when click the back button it shows the below exception in the Logcat. why it happens.
My Log CAT Value:
CODE:..............
What is the Activity Thread Exception in Android? Please Help.
View 1 Replies
View Related
Aug 5, 2010
I don't know why this is generating an ArrayOutOfBoundsException! It's likely I've overlooked something because I'm so tired but if someone could tell me what is wrong I'd appreciate it. Code...
View 2 Replies
View Related
Nov 21, 2010
I'm getting a "SAXParseException: Unexpected end of document" error when trying to parse an xml document on android. The document in question is from the google weather api, but it seems to throw the same error regardless of the xml file in question (as long as the xml is valid) so I suspect it's a problem with my approach, rather than the xml. This is being done as a learning exercise, so I've probably (hopefully) overlooked something obvious. I've run the xml through an online validator, and it comes back as being well formed. (Can't tell me if it's valid as I don't have a DTD, but I dont think I need the DTD to parse the xml). This is the code that I'm using to try and parse the file:
private void refreshForecast() URL url;
try { url = new URL( "http://192.168.1.66:8000/google4.xml");
URLConnection connection = url.openConnection();
HttpURLConnection httpConnection = (HttpURLConnection)connection;
int responseCode = httpConnection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
InputStream in = httpConnection.getInputStream();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
// falls over here parsing the xml.Document dom = db.parse(in);
} } catch (ManyExceptions e) { ....
} A cutdown version of the xml that produces the error is:
<?xml version="1.0"?>
<xml_api_reply version="1">
<weather>
<forecast_information>
<city>Hamilton</city>
</forecast_information>
</weather>
</xml_api_reply>
The stacktrace is:
11-20 06:17:24.416: WARN/System.err(406): org.xml.sax.SAXParseException: Unexpected end of document
11-20 06:17:24.416: WARN/System.err(406): at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:131)
11-20 06:17:24.416: WARN/System.err(406): at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:110)
11-20 06:17:24.426: WARN/System.err(406): at com.dave.nzweather.WeatherApp.refreshForecast(WeatherApp.java:159)
11-20 06:17:24.426: WARN/System.err(406): at com.dave.nzweather.WeatherApp.onCreate(WeatherApp.java:100)
11-20 06:17:24.426: WARN/System.err(406): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-20 06:17:24.438: WARN/System.err(406): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
11-20 06:17:24.438: WARN/System.err(406): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-20 06:17:24.446: WARN/System.err(406): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-20 06:17:24.446: WARN/System.err(406): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-20 06:17:24.456: WARN/System.err(406): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 06:17:24.456: WARN/System.err(406): at android.os.Looper.loop(Looper.java:123)
11-20 06:17:24.456: WARN/System.err(406): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-20 06:17:24.466: WARN/System.err(406): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 06:17:24.466: WARN/System.err(406): at java.lang.reflect.Method.invoke(Method.java:521)
11-20 06:17:24.466: WARN/System.err(406): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-20 06:17:24.476: WARN/System.err(406): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-20 06:17:24.476: WARN/System.err(406): at dalvik.system.NativeStart.main(Native Method)
11-20 06:17:24.486: WARN/ROGER(406): org.xml.sax.SAXParseException: Unexpected end of document
In the interest of brevity, I've not included the original xml, but it's just the standard weather xml from googles feed. I've also tried a few completely different xml files, (including the sample from http://www.ibm.com/developerworks/xml/library/x-android/) and they all give the same error. (They also all validate as well formed when I run them through an online xml validator). This makes me think that it's not a problem with the xml, but rather with how I'm trying to feed it into the parser.
View 2 Replies
View Related
Sep 18, 2010
I am use OpenHttpConnection(URL) method to connect internet in my android application. But getting "java.io.IOException:Error Conneting".How i can avoid this. Permissions in android manifest had given.
View 1 Replies
View Related
Apr 8, 2009
My application uses WebView to load javascript which calls into Java class (through webview javascript iterface). Can the JavaScript catch exceptions thrown from Java?
View 4 Replies
View Related
Mar 4, 2010
I have some well-debugged XML-RPC interfaces on a site that work wonderfully from both PHP and from JAVA. Using Eclipse I am able to write Java apps using either the Redstone or Apache XML-RPC libraries quite simply. These test cases using the 2 libraries utilize JavaSE-1.6 (jre6) libraries as well as one of the 2 xml-rpc libs referenced above.
My problem is making this work on Android. I have added ADT to my Eclipse setup and easily executed the HelloWorld test using a virtual 1.6 or 2.1 Android device - no problems. Whenever I go into the Build Path in Eclipse and add the external jars for either the apache or redstone XML-RPC libs my console goes wacky with a ton of the following:
Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
If I push ahead and debug the code when it actually ships off the XML request I get an exception out of the XML library on permissions of some sort. Why does this only happen in an "Android" project. These libraries seem to have no problem running in Non-Android standard java configs. Once we proof the ability to talk to our server we can proceed down the road of actually porting our app to Android.
View 2 Replies
View Related
Jun 12, 2010
I wanna add three layout in a TabActivity, but it was force closed when I ran it.
Here is the code:
import android.app.TabActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
public class Test1 extends TabActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("egcquery").setIndicator("EGCQuery").setContent(R.layout.main1));
tabHost.addTab(tabHost.newTabSpec("PatientInfo").setIndicator("PatientInfo").setContent(R.layout.main2));
tabHost.addTab(tabHost.newTabSpec("Comp_Interp").setIndicator("Comp_Interp").setContent(R.layout.main3));}
View 1 Replies
View Related
Sep 30, 2009
i'm andrea from androidiani.com, i'm working on a library that will help developers about managing unexpected exceptions. The library is quite simple on it's idea, but i can't grab the unexpected exception withouth the use of a "global" try catch clausole. I saw the instrumentation class but i think it can't be useful for me..
Obviously the library will be free and the webservice too.. ( unless for the applications that generates quite low traffic ) But i personally don't love the way of global try catch..
View 5 Replies
View Related
Aug 18, 2010
That message can occurr if the receiving code crashes or takes too long. I am writing an appwidget for my application, there are like multiple pending intents are there to launch an activity or receive a broadcast. The Problem I am facing is , some times I get exception saying that the Pending Intents cannot be delivered. And the widget does not responds to the touch from the user. please help me. I am not able to find any alternative also.
View 2 Replies
View Related
Oct 2, 2010
I'm having a hard time resolving a crash report. It's an OutOfMemory exception that occurs during the setContentView in the onCreate of my main activity.
I just want to be sure I understood Android LifeCycle well :
1) The onCreate of my main activity is called once and only once during the life time of my application ? Is that correct ?
2) Just like for the big bang, before the oncreate of my activity, nothing exists for that activity, so memory consumption is zero, no objects exists right ?
So what can cause that sometimes, with random framework and devices, I get an OOM exception ? I mean if say my background image is causing this, it should blow up everytime, on every device, shouldn't it ? I mean the result should be reliable.
The background image is a standard jpg : 360*480 weighing 37kb, nothing fancy really :s
The crash report below :
CODE:.....................
View 8 Replies
View Related
Aug 2, 2009
I've got this problem: When my program using too much memory, it die. Is there an exception or something else to warn me? How can I catch it?
View 11 Replies
View Related
May 4, 2010
I'm trying to create a simple multiplayer game. There's a WorkerService which is supposed to handle all network communication and all interaction between this service and my Activities is done with AIDL. I think this is a standard approach - to enable two way interaction I use also an IWorkerCallback interface (also AIDL).
The problem is that callbacks have to change things in UI which may be done only in UI thread. I've created a Handler (in UI thread) and believed that this is an obvious solution. But, surprisingly, it's not working.
My LoungeActivity calls startServer() method of IWorker interface. Corresponding method of my WorkerService does some job and makes a callback - this works fine. Then WorkerService spawns a new thread and callback from this thread results in a bad Exception being thrown:
Can't create handler inside thread that has not called Looper.prepare()
Here's some code to make it clear:
CODE:............
ServerThread code:
CODE:................
Every method from callback looks like that:
CODE:.................
In Handler's handleMessage() method I'm doing a simple switch(msg.what) and in every case there's a simple UI modification (showing a Toast, changing Text, etc.)
I have no idea why is this Exception thrown.. I've managed to fix it by packing code into a Runnable and calling runOnUiThread() but it still makes me curious - shouldn't a Handler always run in thread that created it?
View 2 Replies
View Related
Dec 27, 2009
Have you seen this exception : I am trying to make Satellite Map view for my application. But no succeed, when start activity that calls Satellite Map Activity following exception throws :
CODE:...................
View 1 Replies
View Related
Nov 13, 2010
I have decided that I hate SQL and for that purpose I am trying to make a helper class that I can reuse over and over and never have to mess with it again but it isnt working!
Here is what i have right now:
CODE:.........
I have included several System.out.println() statements to help me debug the code and find problems so please ignore them. PrintDB is another test that I wrote that I am using to make sure everything is working. Now this is what I have written to make sure everything is working....
CODE:.....................
Running this code everything goes great and all the System.out.println() statements have the right information in them until it gets to the databaseView.setText(db.printTable(tableName));
part and it throws an exception
CODE:................
This has me so confused because that same line of code is used in the getColNames() method that was called several times before this and ran with no problem. Also if the table didn't exist wouldn't it have thrown an exception when I called insertRow()? I called that method 5 times in a row with not a single exception thrown! What is happening here?
Implement onCreate() in your DBOpenHelper. Put there content of the createTable() method.
Why would it be necessary to create the table in the onCreate() method? If I were to do this would I be able to use my existing method to do so and just call it from this method?
And the second why you don't use content providers and uri >concept which is already SQLless?
View 1 Replies
View Related
Oct 14, 2010
I tried to connect to a server through a SOCKS server in an Android client app (Android OS 1.5 and 1.6) with below snippet code:
CODE:......
However it gave out an exception on the last line:
CODE:.....................
View 1 Replies
View Related