Android :: Window.opener - Null - Is Not An Object
Jun 22, 2009
I have a webview with a FriendConnect button to allow a user to login to FriendConnect.
When clicking on this button, I'm taken through the expected screens for logging in.
However, it seems like the last redirect after logging in fails with a Javascript error in the browser:
CODE:...............................
View 2 Replies
Oct 29, 2012
I've gone through the Notepad Tutorials and they are all working on my virtual device. I am now stuck in the midst of trying to write my own Android app.
My setup:
Windows 7 SP 1 64-bit
Eclipse Indigo Service Release 2
Android Development Tools 16.0.1.v201112150204-238534
Android Virtual Device Platform 2.3.3, API Level 10, CPU/ABI ARM (armeabi)
The app is about as simple as they come - you enter a number, it divides it by another number and displays the result.Here is the code involved:
AndroidManifest.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.driving"
android:versionCode="1"
android:versionName="1.0" >
[code]...
By the time DrivingTimeEstimator's onCreate() method gets executed, the Bundle object (savedInstanceState) is null (which I'm guessing is what leads to mMiles being null, which throws a NullPointerException and kills everything).
View 3 Replies
View Related
Jan 9, 2010
I am creating an application which retrieves images from the web. In case the image cannot be retrieved another local image should be used.
While trying to execute the following lines:
CODE:................
The line if(drawable.equals(null)) throws an exception if drawable is null.
Does anyone know how should the value of drawable be checked in order not to throw an exception in case it is null and retrieve the local image (execute drawable = getRandomDrawable())?
View 5 Replies
View Related
Sep 3, 2010
I have a very simple Android activity layout like this:
CODE:..
Now when I (from onOptionsItemSelected) do the following:
CODE:...............
The contents of imgView is allways null!
View 1 Replies
View Related
Aug 16, 2010
I am following the Parcelable example in the Android developer guide with the intention of having a more complex object that I send to different activities. Right now, my class is a wrapper of a String member. If I put the object in the intent and read it back from the Intent it reads as expected, however, on the receiver side, it is always null-pointer.
View 1 Replies
View Related
Aug 8, 2010
I have an activity that implements LocationListener in my application and my onLocationChanged method has been working perfectly up until recently. For some reason the Location object being passed into the method is null. My question is, why is it null? Does it pass in a null object if it cannot acquire a location?
My GPS is on and I have it set to pull a location from the GPS, and I know my GPS can get a fix on me as I used Maps and had it locate me.
Also, I have the permission for my app set as:
CODE:.................
I don't believe permissions is the issue though, as my activity was working beforehand and I have not altered the permissions since then.
Here is the code that determines the provider of the location object:
CODE:.............
Here is the LogCat output of the error:
CODE:..............
I have tested the same code on another device (an HTC MyTouch 3G to be precise) and it works flawlessly with the GPS, however on my Motorola Droid it crashes.
View 3 Replies
View Related
Apr 14, 2010
I'm trying to open a dialog window, but every time I try to open it it throws this exception:
CODE:.................
I'm creating it by calling showDialog with the display's id. The onCreateDialog handler logs fine and I can step through it without an issue, but I've attached it since it seems like I'm missing something:
CODE:............
Is there something missing from this? Some questions have talked about having this problem when creating a dialog from onCreate, which happen because the activity isn't created yet, but this is coming from a call from a menu object, and the appContext variable seems like it is correctly populated in the debugger.
View 3 Replies
View Related
Sep 9, 2009
I want to do some automated testcase with Instrumentation . Suggest that my AUT has 2 Activity. After clicking the button in ther first Activity, the second one will be shown with new content base on what we enter in the first Activity.) Instrumentation provides us the function called startActivitySync() and return the Activity object for processing. My question is how we can get the pointer of the second Activity after the it is shown by clicking the button on the first activity.?
View 2 Replies
View Related
Jun 8, 2009
I would like to convert a Picture object to Bitmap object in memory, without writing data to disk.
View 2 Replies
View Related
Sep 1, 2010
What is the basic difference between the PhoneWindow and MidWindow policies? I found that the emulator version takes the implementations of the PhoneWindow.When the MidWindow implementations will be used? Also, I found that PhoneWindow handles the call settings implementation and the same is not there in MidWindow? Please someone help me pointing out the differences between both the policies and under which circumstances which one will be used.
View 6 Replies
View Related
Sep 21, 2009
I have an Activity that running on system. I can get the Intent that is used to start the activity. But i don't know how to get the Activity object from the Intent object or something else. Can anyone tell me how to do this??? Note that, I don't use Instrumentation object.
View 11 Replies
View Related
Feb 18, 2009
I am trying to get a FileInputStream object on an image that the user selects from the picture gallery.
This is the android URI returned by android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI content://media/external/images/media/3
When I try to construct a java URI object from this object, I get an IllegalArgumentException with the exception description Expected file scheme in URI: content://media/external/images/media/3 whereas the android URI shows the scheme as content
Never found a solution for the original question. But if you want the byte stream of an image in the pictures gallery, this piece of code will do that.
CODE:...................
View 4 Replies
View Related
Feb 7, 2010
<html>
<script language="javascript">
/* This function is invoked by the activity */
function wave() {
alert("1");
document.getElementById("droid").src="android_waving.png";
alert("2");
}
</script>
<body>
<!-- Calls into the javascript interface for the activity -->
<a onClick="window.demo.clickOnAndroid()"><div style="width:80px;
margin:0px auto;
padding:10px;
text-align:center;
border:2px solid #202020;" >
<img id="droid" src="android_normal.png"/><br>
Click me!
</div></a>
</body>
</html>
What is "window.demo.clickOnAndroid()"? I know that clickOnAndroid is a method in my Android application. But what is window and demo? My file is called demo.html. Is that it?
View 2 Replies
View Related
Jan 28, 2010
I am having issues regarding a LocationListener in my Service called myService.
Here is my code:
///onStart method ..
onStart() {
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE)
.
.
provider = locationManager.getBestProvider(criteria, true);
locationListener = (LocationListener) new MyLocationListener();
locationManager.requestLocationUpdates(provider, 0, 0, locationListener);
}
In my Activity there is a button which should stop the service. On the click of the button I am doing:
stopService(new Intent(getApplicationContext(), myService.class).................
View 1 Replies
View Related
Mar 8, 2010
Is there an equivalent to Java's null layout in Android? Basically I want to specify the x and y coordinates of each component and not have the layout manager choose where they go. They will be within a scroll pane so it doesn't matter whether they fit on the screen.
I know null layouts are generally not a good idea but I have a special case where I need it. I'm porting a Java TV guide app and the program grid is made up of JLabels. The program dynamically generates them all, setting the x and y coords based on start/end time and channel. Each program could start and end at any time so as far as I know a table layout won't work.
View 1 Replies
View Related
Jul 9, 2010
I have a picture in the setImageResource, but I want to make it null; so far I am using i.setImageResource(1), but would like to know a better way.
View 2 Replies
View Related
Jan 30, 2009
I am trying to run a simple program which shows lat and long values but Location value is always null.
CODE:...
Emulator shows alert force close - wait
How can i debug line by line, at the moment i am usinng if, else to see veriable value.
View 2 Replies
View Related
Dec 16, 2009
I am facing with problem related to the Location API.
I tried the following code:
CODE:...................
View 4 Replies
View Related
Sep 30, 2010
CODE:......
This is my preference xml. But
CODE:.............
Always returns null. I am debugging on a device (HTC Wildfire).
View 2 Replies
View Related
Sep 7, 2010
I changed test.kml to test.xml.
When i tried this XmlResourceParser x = this.getResources().getXml(R.xml.test);
It returns null.
What am i missing?
Below is the kml.
CODE:.....................
View 2 Replies
View Related
Aug 26, 2009
I am having a real hard time with the geocoder API of android sdk 1.5rc2. In my app I am trying to get the addresses corresponding to a location name by using the getFromLocationName method of the Geocoder class. But the problem is whenever I call this method it returns a null value. I have also pushed a geodb file containing some fake addresses at 'data/misc/location' directory in the phone.
The format of the data in the geodb file is as follows :
address 1 latitude "38.898763" longitude "-77.036655" line 0 "1600 Pennsylvania Ave NW" line 1 "Washington, DC 20006" locality "Washington" region "DC" postalCode "20006" countryCode "US" countryName "United States"
and following is the code snippet : Geocoder geocoder = new Geocoder(this, Locale.getDefault()); List<Address> addresses=geocoder.getFromLocationName("1600 Pennsylvania", 10);
View 2 Replies
View Related
Jun 15, 2010
I'm working on an application where I want to add adWhirl to manage adds. The app is working fine until I tryed to use adWhirl. I have try to get the view created with setContentView(R.layout.main) by calling LinearLayout layout.
View 2 Replies
View Related
Jul 12, 2010
I have super.xml and a subset.xml.
...............
I get a null pointer exception at price.setText(data.getStrTotalPrice()); Very strange, name.setText(data.getStrDescription()); does not give a null pointer exception.
View 3 Replies
View Related
Nov 15, 2009
Following other threads - I'm trying to get a unique device ID from the device. I tried this:
String ID = Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
but this returns null when running on my G1. Is it supposed to be returning a valid number, or am I accessing it wrong? I don't want to use the telephony device ID because that requires more permissions.
View 13 Replies
View Related
Jul 14, 2009
I am running this piece of code..............
View 10 Replies
View Related
Feb 26, 2009
I am trying to solve my problem about InputStreamReader returns null..I have a Login screen which checks the configuration file. and here is the configuration class import java.io.*;
import j2me.microtools.BufferedReader; import j2me.microtools.BufferedWriter; import j2me.microtools.FileReader; import j2me.microtools.FileWriter;.....................
View 2 Replies
View Related
Feb 1, 2009
why RingtoneManager.getRingtone(this, Settings.System.DEFAULT_RINGTONE_URI); always returns null when launching from my activity? Shouldn't it return some object which is System.DEFAULT_RINGTONE_URI, which I can then play()? Is there any small example of code which shows how to play Ringtone from Activity? MediaPlayer way also not works. MediaPlayer.create(this, Settings.System.DEFAULT_RINGTONE_URI)
simply crashes with:
02-01 11:19:51.008: ERROR/TAG(351): null 02-01 11:19:51.008: ERROR/TAG(351): java.lang.NullPointerException 02-01 11:19:51.008: ERROR/TAG(351): at android.content.ContextWrapper.getContentResolver(ContextWrapper.java: 89) 02-01 11:19:51.008: ERROR/TAG(351): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:589) 02-01 11:19:51.008: ERROR/TAG(351): at android.media.MediaPlayer.create(MediaPlayer.java:516) 02-01 11:19:51.008: ERROR/TAG(351): at android.media.MediaPlayer.create(MediaPlayer.java:497)
View 2 Replies
View Related
Feb 5, 2010
The GPS on my Android phone is on, supported by the fact that :
location_manager.isProviderEnabled(LocationManager.GPS_PROVIDER)
returns true. Yet, the following line: Location location = location_manager.getLastKnownLocation(LocationManager.GPS_PROVIDER); returns null.
View 1 Replies
View Related
Mar 19, 2010
I'm currently working on Mangler's Android implementation. I have a java class that looks like so:
public class VentriloEventData {
public short type;
public class _pcm {
public int length;
public short send_type;
public int rate;
public byte channels;
};
_pcm pcm;
}
The signature for my pcm object:......................
View 1 Replies
View Related
Sep 4, 2010
HashMap myMap = (HashMap) getLastNonConfigurationInstance();
myMap is always null. getLastNonConfigurationInstance() should return an object.
public Object onRetainNonConfigurationInstance()
{
HashMap myMap = new HashMap();
myMap.put("symbol", this.symbol);
final Object data = myMap;
return data;
}
View 1 Replies
View Related