Nov 25, 2013 17:25
:D
Nov 25, 2013 17:04
It is revived by Android if you return START_STICKY
Nov 25, 2013 17:02
So you wouldn't use any service?
Nov 25, 2013 17:01
But you could give him some pointers, Seva. How would you approach the problem? I'm curious...
Nov 25, 2013 16:51
That's how I would do it. And also return the START_STICKY flag (developer.android.com/reference/android/app/…) on the services to ensure they always get recreated if Android decides to destroy them.
Nov 25, 2013 16:45
Why don't you implement broadcast receivers in these services to communicate with each other?
 
Nov 23, 2013 14:37
You are welcome. Glad I could help.
Nov 23, 2013 14:33
Please, accept my answer if it works.
Nov 23, 2013 14:32
did you call setContentView(R.layout.your_layout) where your progress bar is located?
Nov 23, 2013 14:30
I can see from the rest of your logcat that your problem was at android.app.Activity.findViewById(Activity.java:1637). So it has nothing to do with your BroadcastReceiver implementation. You are trying to call a findViewById() with a null object, probably a null inflater.
Nov 23, 2013 14:29
The number 19, after MainActivity.java refers to the line in your code where the error occurred.
Nov 23, 2013 14:28
?
Nov 23, 2013 14:28
First thing, you see in your logcat, for example, this line: 1-23 14:20:23.723: E/AndroidRuntime(20992): at com.example.serwis.MainActivity$1.(MainActivity.java:19)
Nov 23, 2013 14:28
Hi
Nov 23, 2013 14:27
What code is in the line of the exception?
Nov 23, 2013 14:27
Yes, but your logcat refers to a line in your code where the error occurred. I need to know where the null pointer was found to be able to help you further.
Nov 23, 2013 14:27
onCreate of your main activity. In your service just call the sendBroadcast like I mentioned in my answer.
 
Nov 22, 2013 10:56
good luck!
Nov 22, 2013 10:55
Then try posting another question related to getting data from the web.
Nov 22, 2013 10:55
You will see your problem is in getting the data from the url. You need to debug that later and find out where is the problem.
Nov 22, 2013 10:55
just set speakText = "test"; somewhere.
Nov 22, 2013 10:54
to test your tts, do the following. Remove all the http request part
Nov 22, 2013 10:53
What is your logcat now? same as above?
Nov 22, 2013 10:50
and what is the error now?
Nov 22, 2013 10:50
where?
Nov 22, 2013 10:48
You don't have permission on the url you are passing
Nov 22, 2013 10:48
It's related to your http request
Nov 22, 2013 10:48
That's a problem with your other part of the code. Look at the error code and line.
Nov 22, 2013 10:45
Did you debug it?
Nov 22, 2013 10:42
See my edit on the answer.
Nov 22, 2013 10:42
What do you mean?
Nov 22, 2013 10:42
No, you are not. When you call new TextToSpeech() you have no guarantees that the onInit() will be called immediately next. Your onCreate() method will very likely continue with the rest of its code all the way down to the tts.speak() call before the call back to the onInit().
Nov 22, 2013 10:42
One simple solution: On your onCreate(), add your text to speak to a global variable. When your onInit() is called, refer to this global variable to get the text to speak back.
 
Nov 17, 2013 18:00
Let me know if this works. I will wrap this up as an answer to your question.
Nov 17, 2013 17:59
Note that I used FragmentStatePagerAdapter instead since, as I understood, you will be adding more fragments later.
Nov 17, 2013 17:58
Is this what you wanted?
Nov 17, 2013 17:58
Nov 17, 2013 16:47
the full source of the mock above, I mean.
Nov 17, 2013 16:47
It would be more helpful if you could send me the full source so I can add to a project here and debug. I will try to put something together if you can't reply now.
Nov 17, 2013 16:24
just give me some time. I was away and just came back.
Nov 17, 2013 16:24
hey
Nov 17, 2013 14:50
I never tried but I don't see why not.
Nov 17, 2013 14:46
let's see if we can get this working. It might be worthy knowing for future reference as well. :)
Nov 17, 2013 14:45
can't promise anything though. :)
Nov 17, 2013 14:45
if you can send me a mock code i can try to test it for you as well for a bit
Nov 17, 2013 14:45
I'm curious now
Nov 17, 2013 14:43
or what doesn't work?
Nov 17, 2013 14:43
but what is the error?
Nov 17, 2013 14:42
got it
Nov 17, 2013 14:42
ok