• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Get values from accelerometer

milo8

Lurker
Dec 12, 2013
4
0
Hello everybody.. my problem is this, i have my main class and a second class that displays the values of the accelerometer on a textview.. however if i call my accelerometer class this is what happens, my application starts with no problems however no buttons work from my main class.. it seems to me that the accelerometer class runs above my main class thats why i have this problem.. what i did is i created a new activity on my manifest and called my accelerometer class from my main class using->
Intent i = new Intent(this, AccelerometerClass.class);
startActivity(i);
Am i doing something wrong?

Maybe there is a way to just take the values from the accelerometer class,wihout calling the class itself ???? what i mean is take the x,y,z(int) values from accelerometer class and set them on a text from the main class.. please help.. thnks :):):):):):thinking::thinking::thinking::thinking::thinking:
 
Hello everybody.. my problem is this, i have my main class and a second class that displays the values of the accelerometer on a textview.. however if i call my accelerometer class this is what happens, my application starts with no problems however no buttons work from my main class.. it seems to me that the accelerometer class runs above my main class thats why i have this problem.. what i did is i created a new activity on my manifest and called my accelerometer class from my main class using->
Intent i = new Intent(this, AccelerometerClass.class);
startActivity(i);
Am i doing something wrong?

Maybe there is a way to just take the values from the accelerometer class,wihout calling the class itself ???? what i mean is take the x,y,z(int) values from accelerometer class and set them on a text from the main class.. please help.. thnks :):):):):):thinking::thinking::thinking::thinking::thinking:
What i understand?
Two separate class to Display Accelerometer and text view.

Why can't you use same class for displaying Accelerometer and textview?
 
Upvote 0
My main class has many lines of code.. So i created a second class
Tha shows the accelerometer values on a textview.. I just want to call that class
When my app starts so i can display those values.. The main problem is thay when i call the second class'accelerometer' ovverides my main class and because of that nothing of my main class works .. For example when i call the acceleroneter class , a button that i have created on my main class wont work... I dont know what im doing wrong .. Please help:)
 
Upvote 0
No i have two classes , main and accelerometer.. In my manifest i set up a second activity so i can start the accelerometer class.. In simple words i have two classes and two activities.. Both activities start but the second one overrides the first one.. I mean i can see the values in textview created from the accelerometer class but buttons from main class wont work..
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones