15,894,460 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Chinedum Ezeozue (Top 47 by date)
Chinedum Ezeozue
29-Nov-21 17:33pm
View
Thanks. I have fixed it since by the way
Chinedum Ezeozue
19-Aug-21 7:38am
View
Okay, thanks a lot for your suggestion🙏 I really appreciate
Chinedum Ezeozue
18-Aug-21 9:51am
View
I have no idea about how to do it. That's why I came here for experienced devs help
Chinedum Ezeozue
10-Jul-21 18:38pm
View
Sure, I respect you guys method here, that's why I come help. Thanks a lot, I'll try it out
Chinedum Ezeozue
9-Jul-21 17:40pm
View
I checked it out and while it seems quite comprehensive, it focuses majorly on requesting the device's current location. You also make use of JSON while my app is based on retrofit, then you use AccuWeather API while I use OpenWeatherMap, and lastly, I saw no part that talks about setting up icons. So please I still need your help on my app if there's any way you can assist. Unfortunately, I'm in college and short of funds if not I'd have hired a tutor but the little funds I have are what I'll use in the release and ads of my app when it's done. So if you could just suggest some snippets to try out, so that I could eventually take it to StackOverflow and ask for further help. Taking it there with the current state will only heed some downvotes. I'll appreciate your help
Chinedum Ezeozue
22-May-21 11:58am
View
Yeah, same with what I suspected. But how do I fix it knowing that i don't want the search
onclick listener to affect it in any way?
Chinedum Ezeozue
22-May-21 7:19am
View
It's running now after changing the sound format. Please post this as an answer so that I can accept. Thank you very much
Chinedum Ezeozue
22-May-21 6:42am
View
I guess using the "places AutoComplete API" may be a good suggestion since it will disable the user from searching any city not pertaining to the suggested ones. Looking at my app, any strong suggestion concerning it? or any headstart?
Chinedum Ezeozue
22-May-21 6:37am
View
On "checking for that in the onResponse() method", I don't know what to change to fix it.
Chinedum Ezeozue
21-May-21 17:03pm
View
Deleted
Now, It displays the following: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference
at com.viz.lightweatherforecast.Activity.HomeActivity$1.onClick(HomeActivity.java:70)
Chinedum Ezeozue
21-May-21 17:02pm
View
Now, It displays the following: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference
at com.viz.lightweatherforecast.Activity.HomeActivity$1.onClick(HomeActivity.java:70)
Chinedum Ezeozue
21-May-21 9:40am
View
It's compile error
Chinedum Ezeozue
21-May-21 9:39am
View
Please are you sure? It's just for button click sound. Not music
Chinedum Ezeozue
17-May-21 12:17pm
View
You're more rude. I can never be rude to one who respects small young devs looking for help. You threw code at me and said "use it as you like, it's none of my business". Knowing fully well that I have difficulties understanding it myself
Chinedum Ezeozue
17-May-21 11:52am
View
Okay, I've posted the class here
Chinedum Ezeozue
17-May-21 11:47am
View
Yeah, that's why I told you not to bother. I fixed it using a way much better method than the one you suggested
Chinedum Ezeozue
16-May-21 23:13pm
View
Yes. And I got the following error:
java.lang.NullPointerException: Attempt to invoke virtual method 'com.viz.lightweatherforecast.Retrofit.Example$Main com.viz.lightweatherforecast.Retrofit.Example.getMain()' on a null object reference
at com.viz.lightweatherforecast.FirstFragment$1.onResponse(FirstFragment.java:104)
at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0$DefaultCallAdapterFactory$ExecutorCallbackCall$1(DefaultCallAdapterFactory.java:89)
at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$3wC8FyV4pyjrzrYL5U0mlYiviZw.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6819)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:497)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:912)
But only when an unavailable city is searched
Chinedum Ezeozue
15-May-21 15:12pm
View
Teach me how to be perfect
Chinedum Ezeozue
15-May-21 13:57pm
View
Thanks, but I already fixed it using this solution: https://stackoverflow.com/a/66146060/15804753
Chinedum Ezeozue
15-May-21 13:55pm
View
It was his idea and it was quite off point for my app
Chinedum Ezeozue
15-May-21 13:52pm
View
No, I'm using OpenWeatherMap API
Chinedum Ezeozue
15-May-21 13:50pm
View
It calls the example class code setup in the ApiInterface.
The app doesn't show error. I can easily search any city and get the result. But when I search an unavailable city, it returns "(my app) has stopped" On my phone.
I've included my interface class in the code.
Chinedum Ezeozue
14-May-21 18:03pm
View
I just fixed it now using a custom deserializer. Don't even think not helping me will stop me from making it work
Chinedum Ezeozue
14-May-21 16:55pm
View
Exactly so you shouldn't have attempted to help me right from time when it's not from your heart because such code will always fail. I've told you my app is different and whether you help or not, I'll still find a solution at last. Don't do what's not from your heart please
Chinedum Ezeozue
14-May-21 15:40pm
View
I called my getPrettyDate() in my fragment
time_field.setText("Last Updated:" + " " + response.body().getPrettyDate());
after
Converting in my example class.
How do I call this one? Or you mean just writing this code on the example class that way will fix it?
Chinedum Ezeozue
14-May-21 13:54pm
View
Okay. After converting this in my example class, how do I call it in my activity and fragment? Dt, sunrise & sunset section specifically?
Chinedum Ezeozue
14-May-21 12:53pm
View
No your not understanding. I don't want to convert 1620792785, but any data the dt, sunrise and sunset returns whenever the user searches for a particular city.
But they always return instance like that. It's not specific since it's not only a city
Chinedum Ezeozue
14-May-21 12:50pm
View
It's a UTC time value according to the documentation https://openweathermap.org/current
It just gave suggestion of either I change first parameter(int) to string or I use int parser. And it was because I made
public static String toDate(int time) {
SimpleDateFormat HMM = new SimpleDateFormat("hh:mm a");
HMM.setTimeZone(TimeZone.getTimeZone("UTC"));
final Date date = new Date(time*1000);
return HMM.format(date);
}
Static.
Chinedum Ezeozue
14-May-21 12:45pm
View
Both sunrise and sunset are not specific, that was why I gave an instance.
Like I said
My app can search for any city, so I'm not getting for a particular timezone but for all cities.
Chinedum Ezeozue
14-May-21 12:16pm
View
I've reduced it to the bare minimum
Chinedum Ezeozue
14-May-21 11:55am
View
Oh k I'm sorry, I'll edit it and let you know
Chinedum Ezeozue
14-May-21 11:43am
View
Sometimes, you have to post the code in order for the person helping you to actually fix the exact fault because you may give a solution to converting dt which may end up not corresponding with my app since they're many ways of doing it.
At least from what I've tried, you can show me a correction to that which may solve the issue.
Chinedum Ezeozue
14-May-21 11:00am
View
It's obvious, code project is a wrong place to look for answers. How can you show me documentation when I asked for help. How sad
Chinedum Ezeozue
26-Apr-21 1:46am
View
Sure, but I had no idea how to fix it
Chinedum Ezeozue
25-Apr-21 17:34pm
View
Ok, thanks
Chinedum Ezeozue
25-Apr-21 17:00pm
View
This didn't fix my problem
Chinedum Ezeozue
8-Apr-21 13:21pm
View
It now displays the splash screen on the notch area. It was displaying on the notch before, the notch was dark that time
Chinedum Ezeozue
8-Apr-21 12:55pm
View
I fixed the error by adding this line to the cutoutmode.
tools:targetApi="o_mr1">shortEdges
But thanks for your concern
Chinedum Ezeozue
7-Apr-21 23:14pm
View
I didn't screenshot the whole app because I've not launched it on the stores yet, so don't wanna show how the logo looks like... But then the app doesn't display on the notch area, that's the problem
Chinedum Ezeozue
7-Apr-21 23:12pm
View
Sure https://drive.google.com/file/d/1UVvbGHXzcXHxt1fKd1be77D8kRjjcia_/view?usp=drivesdk
Chinedum Ezeozue
22-Mar-21 14:35pm
View
Okay thanks a lot! This was helpful
Chinedum Ezeozue
22-Mar-21 4:10am
View
Yeah that's exactly it. I know it's not a good design and I'd have loved to use only the fragment's element, but there's only a search button that searches for weather city in the activity, it needs to be linked to the fragment otherwise, I won't be able to access the fragment data.
Can't there be a way to do it even if it's not a good design? Can't it work?
Chinedum Ezeozue
18-Mar-21 8:11am
View
It's okay, I appreciate your concern
Chinedum Ezeozue
18-Mar-21 7:15am
View
Please I'm not saying run the code for me, I've spent several hours trying to figure out a solution, yet I'm able to achieve nothing. My only plea is is how to call the getActivity in such a way it will not return null because it returns npe whenever I use the oncreateview, it may work on the onActivityCreated but I've not found a way to do that, please help
Chinedum Ezeozue
17-Mar-21 8:49am
View
I don't understand what you really mean by the debugger. Is that "debug" on logcat?
If it is, it shows W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.ComponentName.getPackageName()' on a null object reference
W/System.err: java.lang.NullPointerException: null receiver
2021-03-17 13:44:13.775 1580-1666/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
But "Run" shows the error i posted up.
Chinedum Ezeozue
17-Mar-21 8:47am
View
Sure i did, the id name is correct
Runtime error still shows the exact same error
Chinedum Ezeozue
17-Mar-21 7:07am
View
I did call the getText in my fragment(line 60)
EditText textfield = getActivity().findViewById(R.id.textfield);
Show More