• 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
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 :):):):):):confused::confused::confused::confused::confused:
 
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 :):):):):):confused::confused::confused::confused::confused:
What i understand?
Two separate class to Display Accelerometer and text view.

Why can't you use same class for displaying Accelerometer and textview?
 
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:)
 
Are you using two activity?
If yes means you can Use Intent to transfer data.

If one activity,and two class means,you have some logical error in your program.
Check that.
 
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..
 
How can i take the values of accelerometer class using intent and display them in my main activity textview? Please:)
 
Back
Top Bottom