Android

Don't say hi. Don't ask questions. Don't have fun. Don't do an...
Feb 21, 2022 08:25
0
Q: Illegal State Exception in mediaplayer.prepare android

StarI am using a method in asynctask in the class VideoSurfaceView. But I am getting crash. I tried other ways too but didn't worked. Below is the code: ...... public class VideoSurfaceView extends SurfaceView implements SurfaceHolder.Callback { private static final String TAG = "VideoSurfa...

Nov 26, 2021 12:00
@Tim any idea?
Nov 26, 2021 11:32
can someone help me please
Nov 26, 2021 11:32
I am clueless.
Nov 26, 2021 11:32
where this blue line is present in aosp source code? so that I can restrict?
Nov 26, 2021 11:31
0
Q: Black Screen with Blue line animation android

StarI am using aosp 10 source code and all system apps are working fine but when I deploy apps with api version less than 23, I am getting a black screen with two blue vertical line animation for few seconds and then loading the activity. Other apps are working fine.

Nov 26, 2021 11:30
Any idea why?
Nov 26, 2021 11:30
Hello all, I am using android 10 and when i use app below version 23, I am getting blue line for few seconds and then activity gets displayed
Nov 26, 2021 11:29
 
Jul 4, 2019 07:03
crash as declares multiple JSON fields named Poster
Jul 4, 2019 06:48
no multiple json value passing not possible
Jul 4, 2019 06:35
okay let me check @LakhwinderSingh
Jul 3, 2019 12:59
based on this, it's displaying..and "Poster" is not displaying
Jul 3, 2019 12:59
if i specified as @SerializedName("Poster ")
private String Poster;
Jul 3, 2019 12:59
but this is displaying only the specified field.
Jul 3, 2019 12:58
Log.e("responseRetrofit => ",new Gson().toJson(response));
Jul 3, 2019 12:58
and i tried printing like this too
Jul 3, 2019 12:53
E/responseRetrofit: responsemovie.demo.DataModel.MovieResponse@2d1371b
Jul 3, 2019 12:52
when i used Log.e("responseRetrofit","response"+response.body().toString());, in this case, it prints as
Jul 3, 2019 12:51
sorry...i left body.toString
Jul 3, 2019 12:51
responseResponse{protocol=http/1.1, code=200, message=OK, url=api.myjson.com/bins/18buhu}
Jul 3, 2019 12:51
b/w when i print the response, i get as
Jul 3, 2019 12:48
okay sure. Take care. Bye. Catch you tomorrow.
Jul 3, 2019 12:47
okay
Jul 3, 2019 12:42
in this case, String newKey = currentKey.replaceAll(" ", "_"); //replaced with underscore. I can replace with "". But problem is where I need to use.
Jul 3, 2019 12:41
@LakhwinderSingh i seen this too but I am clueless where exactly i need to use. stackoverflow.com/a/30228588/3500826
Jul 3, 2019 12:39
okay
Jul 3, 2019 12:35
or i need to justify it's impossible in android side. But my architech is saying u can by gson. (but never given solution, that's different case)
Jul 3, 2019 12:34
i referred.
Jul 3, 2019 12:34
no
Jul 3, 2019 12:33
because it's already done. so they are not touching the code.
Jul 3, 2019 12:33
:( but they are not doing. Escalating to do on your side.
Jul 3, 2019 12:32
yes
Jul 3, 2019 12:32
but backend team is not solving by giving same key by removing whitespace
Jul 3, 2019 12:31
so how to achieve this then?
Jul 3, 2019 12:31
oh k
Jul 3, 2019 12:31
@SerializedName("Poster") //no whitespace
private String Poster; // I am able to get only second one
Jul 3, 2019 12:30
@SerializedName("Poster ")
private String Poster; // I am able to get only third one
Jul 3, 2019 12:30
if I use this
Jul 3, 2019 12:30
in this structure, Poster field contains different format structure. So any one only, I am able to get
Jul 3, 2019 12:29
{
"movies": [{
"Title": "Avengers:Age of Ultron ",
"Year": "2015 ",
}, {
"Title": "TheAvengers ",
"Year": "2012 ",
"Poster": "https://m.media-amazon.com/images/M/MV5BNDYxNjQyMjAtNTdiOS00NGYwLWFmNTAtNThmYjU5ZGI2YTI1XkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_SX300.jpg ",
}, {
"Title": "Sleepless ",
"Year": "2017 ",
"Poster ": "https://m.media-amazon.com/images/M/MV5BNjEwMDAyOTM4OV5BMl5BanBnXkFtZTgwMzc4MjMyMDI@._V1_SX300.jpg "
}]}
Jul 3, 2019 12:29
@Lakhwinder
Jul 3, 2019 12:29
it's actually a string. Let me simplify and say. { "movies": { "Title": "Avengers:Age of Ultron ", "Year": "2015 ", }, { "Title": "TheAvengers ", "Year": "2012 ", "Poster": "[m.media-amazon.com/images/M/… ", }, { "Title": "Sleepless ", "Year": "2017 ", "Poster ": "m.media-amazon.com/images/M/… " }]}
Jul 3, 2019 12:29
In the above json structure, first contains no poster field, second contains "Poster" field and third contains "Poster " fields. Third has white space but second and third Poster has url. But I can use only one Poster field.
Jul 3, 2019 12:29
I tried @Joop's solution but I am not able to use two fields at a time @SerializedName(value="Poster", alternate={"Poster ", "Poster"})
Jul 3, 2019 12:29
I used Title.trim but I am getting error as Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference
Jul 3, 2019 12:29
No. Actually I need to acces the url from the Poster but it has two different Poster that's the problem.
Jul 3, 2019 12:29
I tried this but this fixes only for values but not for key.
Jul 3, 2019 12:29
Also i tried this way too. public String getPoster() { return Poster == null ? Uri.parse("R.drawable.ic_launcher_background").toString() : Poster.trim(); }