Win a copy of Java Challengers this week in the Java in General forum!

Milos Gojic

Ranch Hand
+ Follow
since Jan 02, 2017
Milos likes ...
Android Java ME
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Milos Gojic

Hello i am having next problem. I open same topic on StackOverflow but no answer and i am in hurry. In my json as response from server i am getting  this kind of json.I am also getting error java.lang.IllegalArgumentException: Unable to create converter for at my call method getInvestmentsInForce()


so I don't know how to change these numbers inside percentage. It won't be the same all the type but will change dynamically

My model :



and in my InvestmentForceRegisteredInvestments :


and my PercentagesInvestmentInforce:


if there no numbers at all then my public class PercentagesInvestmentInforce  will be empty

and my call
1 month ago
Hello i asked the same question few days ago on StackOverflow but no answer...and i kinda  need an answer

The problem is that Glide .listener() is triggered image by image, so when i tried to set my fragment layout invisible until all images are loaded, it set's fragment layout visibility to visible after first image is loaded and  ignores the fact that rest of images are still not loaded into imageview.
Glide checks with it's listener images by images and after first one is ready it set's my visibility t visible and i do not want this..i want to my fragment layout be invisible until all images are ready to display. Now i will basically past my SstockOverflow post here.

i have a fragment with several recycleviews that contain some text and image from users. Problem is that my images are loaded a second or less after my layout is inflated. I can't use any placeholder for that time or something else.
My instructions are that my layout must be shown only when all data and images are ready from all recyclerviews, and be shown in the same time. I am using glide .listener() method.
I tried: 1)to set boolean value in .listener() and save it in SharedPref and load it in my fragment where my recycleviews are and if Boolean value is the same then set visibility of fragment to visible ,which previously was set to invisible
2) to do the same thing just with custom callbacks
3)and this solution that i am going to past here. Basically i am passing my layout to adapter with constructor and setting it invisible in .listener().



my glide in adapter:

and my adapter:
3 months ago

Norm Radder wrote:

 won't update to server


What server are you talking about?  What protocol are you using to send the String to the server?

Why do you have to use the debugger to see the error message?  Can the code receive/extract the message and print it on the logcat?


I am using retrofit and okhttp...and sung a HashMap to send all data to the server..  but what is weird is that i got some base64

but getting that error
5 months ago

Norm Radder wrote:

my app doesn't crash


What happens when you execute the app?



Simply won't update to server. If i go to debug then i see 400 bad request and in error body i got that error, but my app doesn't crash simply wont do what is supposed to do..
5 months ago

Norm Radder wrote:

i am getting this error.


Can you copy the stacktrace from the logcat and paste it here so we can see the full error?


my app doesn't crash i am getting ths error in my debugger

5 months ago
I posted this question earlier today on StackOverflow,but without answer ,and need this to be solved tonight, that's why am also posting it here...so sorry for cross posting but i am desperate :\

so basically when i try to send string to server i am getting this error.I am trying to send image ,as string, with SharedPreferences from fragment to viewModel and then send it with other data that server expect

my fragment code:

and in my view model i reciving and seting this image this wey:
5 months ago
I posted this question the other day on StackOverflow, but wasn't able to get a good answer, so now I'm asking here...
I am having a spinner that should be filled with strings.But can not use binding.mySpinner to set adapter. The Goal is to have two spinners first is with two country USA and CANADA so when user click on Usa second spinner should list all states.Same thing for Canada.I managed to find out what country is clicked and i stored that value in String.I wanted to use simple If/else statement but do not know how to fill second spinner.

my xml:`

and my ViewModel:
8 months ago

Norm Radder wrote:

java.lang.NullPointerException: Attempt to read from field 'android.widget.TextView com.nswd.successplan.databinding.TvContentBinding.markerValue' on a null object reference
   at com.nswd.successplan.model.HomePieChartMarkerViewModel.refreshContent(HomePieChartMarkerViewModel.java:32)


What variable on line 32 has the null value?  Backtrack in the code to see why that variable is null.



that is line 17 here in post

it seems that is problem.Because it gives me a warning that is not assigned...and i don't know how to do it
10 months ago
I know what is this exception is and I know that there are a lot of similiar questions. But I can't apply those solutions to my problem. Everything works fine when I am using findById() but when I am trying to use data binding I got stuck. I am new in data binding.


and i am calling this class in my fragment:


my xml tv_content


my error

10 months ago
I need to make a list in my NestedScrollView but showing only first element. I tried with android:fillViewport="true" but hothing happened. I know that ListView has scrollable incorporated in itself.

my xml :

my pie_chart_list_item:

10 months ago
I am making simple app in wich user will able to search for books by its name,with google.com book api.For now i wish to present list of books with android in their name.I am doing it woth Retrofit2 and RecycleView,but nothing is showing.I am assyming that problem is in my @query request in RetroFit2,but do not know how to handle this problem on my own

my MainActivity:


and my api inteface:


my recycleview:

my model class:
11 months ago

Norm Radder wrote:I think the problem is that the InputStreamReader on line 24 has read all the contents of the stream into its buffer and the read statement returns the first character from the buffer: {    Note (char)123 is {
There is no more data in the stream so the InputStream used on line 28 returns the -1.
Try using the InuputStreamReader for all the reads, not the InputStream.


I used BufferedReader and now it works fine...you were right problem was in in InputStream... hahahah what a sleepless night
11 months ago

Norm Radder wrote:Try adding a print statement after the statements  on lines 24 and 28 that print out the value of podaci so you can see what is read.


in line 24
In my line 24 it shows number 123

but in line 28 it shows -1 ???

so in my while loop shows that podaci(data) are -1 and stop printing in log...but why??



EDIT: When i put this code :

my second log,in else, is activated like it's failed.
Prints:
11 months ago