Null Pointer Exception on accessing value of EditText

by Ankur Kumar » Fri, 20 May 2011 09:30:39 GMT


Sponsored Links
 Hello Developers,

Please help me with this problem. I am getting
java.lang.NullPointerException at step 3 in my code. Have not been
able to figure this out. The value I am entering in the EditText is
not empty.

                       1.  EditText IPInput = (EditText)
findViewById(R.id.ip);
                       2.  IPInput.getText().toString(); System.out.println(ip);
                       3.  System.out.println(IPInput.getText().toString());

--
Regards,
Ankur Kumar

-- 



Null Pointer Exception on accessing value of EditText

by Ankur Kumar » Fri, 20 May 2011 09:30:40 GMT


 Hello Developers,

Please help me with this problem. I am getting*java.lang.NullPointerException
* at step 3 in my code. Have not been able to figure this out. The value I
am entering in the EditText is not empty.

                       1.  EditText IPInput = (EditText)
findViewById(R.id.ip);
       2.  IPInput.getText().toString(); System.out.println(ip);
        3.  System.out.println(IPInput.getText().toString());



--
Regards,
Ankur Kumar

-- 


Sponsored Links


Other Threads

1. Competitor attack

If anyone wants to see an example of a competitor attack, see:
https://market.android.com/details?id=sixgreen.aos.itap

There is no proof of course but several of the recent ratings/comments show 
the pattern that is common in one of these attacks. Some of the clues are; 
no specific criticism, several 1 stars in a row when the app usually gets 4 
or 5 stars, "baby language" or language that looks like it comes from 
someone too young to own a credit card.
If you look back in the reviews, you will see a lot of good reviews and some 
not so good with specific criticisms, which IMO are fine (and useful to us 
developers) but you will also see another attack that came against this 
particular product (look for Mark and Lisa together on the second page).

This is a real pain in the ass, as its being done solely to drop the rating 
on the app and drive consumers to something else. Whats really a{*filter*}off is 
that there is no way to deal with it except to add your own comment to the 
reviews.

I think Google needs to do something about this, or at least give us a 
method to flag those types of comments so that Google can investigate them. 
There must be heuristics that can be used for detection of this kind of 
behaviour with all the data they keep (I can think of a few already).

If anyone knows another way to catch the competitor thats doing it, i'd be 
glad to hear it!

-- 

2. modify su.c and execute it without the root privilege under /data/data/....

Hello
salut,
i am under linux/android and i want to configure network card without
passing to root

when i tape this commande:
<<ifconfig eth0 up>>
i foud this result:

SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFNTMASK: Permission denied

and as you know that under android, sudo is not found in th ephone
samsung spica

i found the source code of the commande su.c and i modify it like:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>

int main(int argc, char **argv)
{
int ii=0, i=0;
char **exec_args;
exec_args = (char **)malloc((argc + 1)*sizeof(char *));

for (ii=0;ii<argc;ii++)
{printf(" argv[ %d ]= %s \n",ii,argv[ii]);}


exec_args[argc] = NULL;
exec_args[0] = "sh";

if(argc < 2) {
printf("argc < 2 \n");
}

if(setgid(0) ||setuid(0)){// root.root
fprintf(stderr,"su: permission denied ; setgid(0): %d setuid(0): %d
dont gid: %d et uid: %d \n",setgid(0),setuid(0),0,0);
return 1;
}
printf("commancer l'execv \n");
for (i = 1; i < argc; i++)
{
exec_args[i] = argv[i];

}
execv("/system/bin/sh", exec_args);

printf("commancer l'execlp \n");

execlp("/system/bin/sh", "sh", NULL);

fprintf(stderr, "su: exec failed\n");
return 1;
}

and i compiled it and i copied it under /data/data...
and i changed its privilege with chmod 755 /data/data/..../su

and when i execute

<< /data/data/../su -c /system/bin/ifconfig eth0 up >>
my executable su stop in execv("/system/bin/sh", exec_args);

wath's the probleme???? i dont understand why .??

thnks in advance

-- 
.

3. how to implement the permission checks on Native C?

4. Playing VIdeo in background and drawing Activities on top

5. Fragments for Google Maps add on?

6. Set default theme colors for widgets?

7. Need Help..DHD kerendam air