last day (15 days later) » 

4:05 PM
0
Q: How can I call from my app in Android?

Pierpaolo ErcoliHi guys I'm new on android and I'm trying to do a call after pushing an ImageButton on my Activity and I did this snippet as I find on other questions on stackoverflow. icotelefono.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //icotele...

 
what exception you are getting?
 
@Tanis.7x I will write logcat output with a Edit in some seconds
@Tanis.7x here you are
 
what is Hide_Unhide ?
 
the name of the class where this snippet is
 
put a break point before onClick() in Hide_Unhide and then debug.
 
4:05 PM
@Rustam it give me a null pointer exception with a try catch
 
some code will be their in try block check which variable is null?
 
No variables are null but in my opinion there is a problem with the View. :/ I have some problems with view and similar.
@Rustam I also have tried to call from my "hide_unhide" class the method to make the call on my main activity but nothing to do. When the snippet is in main activity with no call from outside it goes, but when I call from another class it makes the error and .. nothing to do :'(
 
can you share the code
 
Yes I can, but, do you want my Hide_Unhide class?
or even the main activity?
there are so many rows
 
main activity
 
4:08 PM
ok
is in the end the method I call from external
is called
prova2
ok?
 
oky
 
where you are calling prova2() ?
 
in hide_unhide
do you wanna also hide_unhide?
 
yep
 
4:16 PM
ok, the call is in the Switch --> case 2
 
why this public void onClick(View v) {
MainActivity prova = new MainActivity();
prova.prova2();
}
 
in the main activity?
it was only for a try
aaah
sorry
I was misunderstanding
because when I click on a button it should call a number
now, is a number in a variable
in the real app will be an array of number from an xml I download
 
public void prova(){
MainActivity richiama = new MainActivity();
richiama.runOnUiThread(null);

}
this is for what ?
 
4:31 PM
another experiment. At the moment it doesn't do nothing. It was to try to .. "refresh" an activity everytime the connection change
 
don't do this much experiment at first step itself
you do one thing
 
just but a break point here by case 2
debug it
 
I put a break point there
and it give me a nullpointerexception
error
 
before getting exception
 
4:36 PM
before getting exception...all is ok
 
where this method is called mostra_nascondi(...)
 
5:02 PM
In another class but the problem is not there
 

last day (15 days later) »