Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Buttons active or accelerometer senzor

 
Braniste Adrian
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy, can help me please? i have this function by pressing a button:



4 buttons in acitivity_main.xml , and i need to move scene , but i have
this function



this function move the scene , how move my phone with accelerometer , and me i need to move the scene or on buttons or on accelerometer senzor
Can you help me plese , becouse i dont know how make that ....
NOT BOTH AT THE SAME TIME


Thanks , Adrian
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

I don't think I understand your question. Can you describe what happens now, what you want to happen, and what the differences are?

Also I edited your post and the subject. I changed the subject from all capital letters since that is often considered yelling on forums, please don't use all-caps. I also added code tags to your post to make it more readable. Please read this: UseCodeTags so you can use them in all your future threads.
 
Braniste Adrian
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now my application to move one object with accelerometer in the right , left , up and down , and I put four buttons to do the same buttons , you press the button above , go up the subject .

But the problem is that the value of the accelerometer is changing all the time contiunuu and returns object position on accelerometer .

The difference is , when I press one of the buttons , the app no longer have access to the sensor and then the buttons work just to have a menu that can activate the sensor ...

That was the question ...

But resolved, we switch off before the disable button , and I made ​​a menu that can activate the sensor again to move the object with sensor ( I move the phone to move the object for example : tilt the phone to the right, subject-matter goes to the right ) .

My approach is good to disable when I press any button , and activate the menu ?

I hope you understand and I apologize for what I did whose fine, as I wrote in big letters as I lined up the code to be more visible.

I'll probably come back later with more questions ..

Thanks a lot
Adrian
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Braniste Adrian wrote:But resolved, we switch off before the disable button , and I made ​​a menu that can activate the sensor again to move the object with sensor ( I move the phone to move the object for example : tilt the phone to the right, subject-matter goes to the right ) .

My approach is good to disable when I press any button , and activate the menu ?

Great, I am glad you were able to solve the problem. Yes, that sounds like a good solution, you might consider adding a new button on the main user interface to re-enable the accelerometer, but that depends on what the program does and how likely it is that a user would want to switch back and forth between the two modes.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!