I have developed app using codename one.It was working fine initially.but since 3-4 days getting issues.When I clicked on Menu Item it giving below error
an internal application error occurred:java.lang.NullPointerException:Attempt to invoke virtual method'void com.codename1.o.al.bj() on null object refference
Iniially every thing was working fine but since 3-4 days it giving issues like that.
Please help me to solve this issue?
Thanks in advance.
I have submited an issue last Friday. This is due to the last update and will be fixed on the next update (next Friday). You can workaround it by disabling the on top side menu for now with: yourForm.getToolbar().setOnTopSideMenu(false);
We can not analyse what went wrong, because error is a generic "Null Pointer Exception". We need to know complete functionality and what different behaviour happened. Please provide us with some more details if possible.
Related
I'm repairing my friend's code and got confused.
My friend wants to fetch entered text (in EditText). Seems easy, right? Well, it is but instead of user input, he gets this warning/error:
To be honest I'm not sure how to fix it. He is coding in Kotlin (Android 10).
Activity that contains EditText:
And XML:
This is how it looks when debugging:
The app started working just fine after running "File -> invalidate Cashes/Restart" option, I just don't understand where this warning came from and how to fix it because the error remained unchanged (even though the app works). Do you have an idea how to solve it?
All the best!
fyi lambda expression like setOnClickListener from kotlin is not debuggable, see here.
if you want to debug variables inside setOnClickListener you should use the normal one e.g. setOnClickListener(object: View.OnClickListener {..})
sometimes there will be problem in auto generated binding files, if so it will be solved after invalidate cache and restart ide. sometimes the warning/error show but the project and complied without errors. so no need to worry about that. for next time post the code as code not screen shots.
I understand that the question is regarding evaluating expression, but there is a way you can read variables from your debugger console, even if you're inside an anonymous callback. I found it helpful sometimes. Here are the steps:
First enter debugger mode inside of your anonymous callback,
In your debugger console, look at the right side for "Frames"
Within Frames under , you'll see stack of function execution first top one on the list is the latest:
Click on row(s) below the latest function, until you find an instance of your activity AddInformationActivity. You will see the activity instance on the right side window under Variables. Don't go as far as selecting functions browned out, because those are from internal libraries.
When you see you AddInformationActivity instance, you can expand it and see its variables.
Hope that helps!
It's not a beautiful way, but if you create a method like this:
private fun debug() {
println()
}
and add a breakpoint on the println() it'll capture the activity.
(Don't use TODO as it'll crash the app with a NotImplementedError once called.)
I have this method now in my code all the time to call it whenever I need it.
I know, that question is old, but I just stumbled over it and needed a way.
I am using TextInputLayout from com.android.support:design:23.3.0
When I first apply an error it is shown correctly.
mInputPassword.setError(getString(R.string.error_invalid_password));
mInputEmail.setError(getString(R.string.error_field_required));
On the next login attempt I clear the error.
mInputEmail.setError(null);
mInputPassword.setError(null);
Then I run the validation and set the error again using the same code as above but this time the red line is applied but the error text is missing.
Anyone have any ideas on why this might be happening or have experienced similar situations?
I saw something similar reported here but it is for an older version of the design library and don't know if it is still a issue in the verison I am using,
You simply has to do these steps:
setErrorEnabled(true);
setError("error");
for clearing:
setError(null);
setErrorEnabled(false);
repeat the first step to set a new error. setError(null) clears the error message and icon, so I think the view to show is simply gone and setErrorEnabled(false) will reset it.
You are clearing the Error Message String:
mInputEmail.setError(null);
mInputPassword.setError(null);
So when you rerun the validation, you will get a blank string.
If you want the error message to go away, clear the erroneous text from the textview:
mInputEmail.setText("");
mInputPassword.setText("");
I had to implement iOS like pull to refresh list in my Android app. I decided to go for this library. It's pull to refresh performance is awesome. But I'm facing one random exception which leads to app crash. It happens sometime that IllegalStateException is thrown pointing to this line in PullToRefreshListView.java in InternalListView class code.
return super.dispatchTouchEvent(ev);
I'm unable to understand this issue. Can any body guide me to solve this issue please.
Please check, you might be calling notifyDataSetChanged() too often in short intervals.
You can go through this link.Chrisbane PullToRefreshListView IllegalStateException
Actually I was missing notifyDataSetChanged() in one of the callbacks. Adding resolved the issue. Thanks everyone who spared time to reply to this question.
I've had a search for this problem but nothing seems to help me to solve this particular error I am getting.
I am writing my first Android app and am coming across a java.lang.RuntimeException whenever I call SetContentView on a new activity.
There is nothing in the logcat which helps (an activity idle timeout is all because it falters on the call).
My activity Login has a layout set during OnCreate which works fine, but any subsequent calls fall over. Here's some code ;)
[Activity(Label = "Usage")]
public class Usage : TabActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
//**FALLS OVER HERE**
SetContentView(Resource.Layout.Usage);
The Resource.Designer.cs has a record of my layout:
// aapt resource value: 0x7f030002
public const int Usage = 2130903042;
...and when I reference that layout by it's int value it falls back to the previous activity without hitting any breakpoints in the Usage activity.
Anyone got any thoughts or can point me in the direction of a similar post?
Legends!
UPDATE
I tried a whole stack of fixes I found on forums etc but nothing would fix this. I put the whole thing on the backburner while I worked on something else, came back to it and now it works...wish I could say what it was that made it work to help others out but I can't explain it! COULD have been an update to a new version of MonoDroid?
As stated in my comment to Stuart's answer, this problem appears to have resolved itself. I revisited the project all this time later and think that it might have just been a case of cleaning the project and rebuilding all. I have not had this problem since.
Sorry that this is not a detailed answer, I would suggest trying the ol' clean and rebuild.
I've recently had some issues when working in VS2010 where the resource ids are being not kept perfectly in-sync with the resource files and the java ids.
To resolve these, I generally find the quickest way is to add a new id to one of the layout xml files - this then causes a regeneration or the resources.cs file which then means the app works again.
If that doesn't help, then please post more info about what the message inside the RuntimeException is,
Although it's very late response, but someone who might be getting this sort of error. Wrap it with try-catch and it gives more details about the exception. I spent few hours before figuring out to do that
I am getting error with the generated java file. But the code is fine and good . Can any one give suggestion.
thanks in advance.
Based on your image it appears that you are getting an error with the element with id of "enter", try changing the id of that element to something more descriptive and the error might go away.
You don't say which error you are getting. Usually you can resolve errors in R.java by removing it, and letting Eclipse regenerate it. If you still are getting the same error, you can try to rename the controls with the offending id.
If you wish further assistance, you need to say which error you are getting.