Android Question Button not working !!!!!

JTmartins

Active Member
Licensed User
Longtime User
Well this is really a dumb question, but I have a panel with 3 buttons.

2 of them are working OK, the other...does nothing.

I've checked and rechecked the code, design and there is nothing in top of it.

Deleted it from code, generated members again in design, tested...pufff. not working.

Has this happened to someone before ? I mean I'created dozens of buttons, never had any problem.

I cant post the project, as is a company project (and quite big) and the little bit of the activity won't work without the rest.

What can prevent the button from working ?

Button name is BtnSMS1 its dimmed in globals and Sub BtnSMS1_Click is there. Button it's enabled in design and there is nothing else with the same name, but by whatever reason it's the only that does nothing. not a single bip I use for test. Debbug never gets there....

help.
 

stevel05

Expert
Licensed User
Longtime User
What is the event name in the designer? And have you initialized it in code after loading the layout?
 
Upvote 0

JTmartins

Active Member
Licensed User
Longtime User
It is working now.

However the mystery will remain in my head.

There was nothing in front of it. The panel is at the botton with 3 navigation buttons. Two of them worked OK, the other one was "dead".

The eventname in designer was the same as the button name (as in all the other 2 buttons)

The event WAS NOT being triggered, don't know why, as everything was correct in the code.

Today I deleted the button from designer (before I was only deleting in the code and recreating members), created another one with a different name . Generated the members tested it. and voila it worked.

I'm pretty sure that there was no mistake in the previous one, neither in design or code. Some glitch must have occured, that goes beyhond my control and this never occured before in the dozens and dozens of buttons I've done so far.

So if something weird happens to anyone similar to this...fastest route seems to be delete the button in code and designer. Create a new one with a diferent name, create the members and it should be ok.

thanks guys.
 
Upvote 0

Justin1234

Member
Licensed User
Longtime User
I'm now having the same problem. My project was working fine, I changed something minor that's not even called yet and now none of my buttons work. I've deleted, renamed, etc. Now I'm outta ideas. Any help?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Without seeing the code it's going to be impossible to give you a concrete answer. Have you changed the name of the callback sub? added a panel that is covering the buttons? Added a call to a sub that reinitializes the buttons? Created a new way out of the callback sub that is always selected? Try putting a log in the callback sub to make sure it's still being called.

There could be many reasons that it is failing.
 
Upvote 0

Justin1234

Member
Licensed User
Longtime User
All I did was change textwriter.writeline to .write and that isn't called at this point in time. I'm sure it's a mistake on my part but I can't work out what.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If you put it back as it was does it work again?
 
Upvote 0

Justin1234

Member
Licensed User
Longtime User
Nope. Just went through line by line with debugger and it's all fine. Runs through everything fine and stops at activity resume.
Lost.... I'm about to try it on another device
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Can you zip and post your project?
 
Upvote 0

Justin1234

Member
Licensed User
Longtime User
Unfortunately it has a lot of business information and financials attached so that's not really possible. Thanks tho. Maybe I should recreate that particular activity and see if that works.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If you can create a small project that fails, or with dummy data that you are happy to post or email to me, I'd be happy to look at it for you.
 
Upvote 0

Justin1234

Member
Licensed User
Longtime User
I created another project with same code and had the same problem so Im gonna have to examine it again. When I can get wifi to my laptop I'll post the code. Thanks.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Then you should check DIMming of the button (in WHICH activity do you DIM and INITIALIZE the button? If the button is designed in DESIGNER then you should check it you have created the members.
If it is created by code: Follow the code do dim, initialize (have you setup the eventname correctly? Have you create the rigth Event in the Activity where you DIMmed the Button?

To see code is normally the best way to help. But without it is hard ;-)
 
Upvote 0

JTmartins

Active Member
Licensed User
Longtime User
Just came back here,

As I said before I had this error, and finaly I think I know where is coming from, as it happened a few more times.

Ocasionaly, as I have to very similar layouts I load a layout in designer then save it imediatly under the new name.

Then I recreate all the members in the new activity and then work on whatever new stuff I need.

Some times the buttons faill.

I check the code and everything is correct. I delete the button. Create another one with a different name, go to the code, change the dim and the button routines names..et voilá it works.

As I said. The only times I had this problem is when I duplicate a layout. Not very logical...but in my case, that's what happened.
 
Upvote 0
Top