Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi All,
- I my application I want to do specific task in a separate thread.I want to know where it will cause any memory leak.
- public class MainActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- runOnThread();
- }
- private void runOnThread() {
- new Thread() {
- private int value;
- @Override
- public void run() {
- while (true) {
- SystemClock.sleep(1000);
- callotherfunction(value);
- }
- }
- }.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement