Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java Android
Hi.
I have a question. How do we call from one class to another, that's within the same package? I do not want to use intent as it will keep creating a new activity. I'm linking a sensor to a timer. Where the timer would start if there's no movement. Thanks for the help.
 
public void onSensorChanged(SensorEvent event) 
{
  if (event.values[0] > 0.6 && event.values[1] > 1.6)
  {
    Toast.makeText(getBaseContext(), "Movement is NOT detected.",Toast.LENGTH_SHORT).show();
    startActivity(new Intent(TestingSensor.this, Timer.class));
  }
  else 
    return;
}
Posted 13-Dec-10 22:04pm
Edited 13-Dec-10 22:33pm
(no name)53.3K
v2
Comments
JF2015 at 14-Dec-10 3:34am
   
Edited to improve code readability.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 319
2 CPallini 275
3 DamithSL 214
4 Maciej Los 185
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 14 Dec 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100