CopyPastor

Detecting plagiarism made easy.

Score: 0.8237013816833496; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2017-12-19
by RejoylinLokeshwaran

Original Post

Original - Posted on 2017-12-19
by RejoylinLokeshwaran



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Mobile back and home button are working well in service class.
public class MyFooterService extends Service{ View myview; WindowManager wm; FrameLayout wrapper; public MyFooterService() {
} @Override public void onCreate() { Log.d(TAG, "onCreate called"); LayoutInflater li = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); wm = (WindowManager) getSystemService(WINDOW_SERVICE); final WindowManager.LayoutParams params = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, 90, //height of ur layout WindowManager.LayoutParams.TYPE_PHONE, 0, PixelFormat.TRANSLUCENT);
params.gravity = Gravity.BOTTOM ; params.x = 0; params.y = 0; wrapper = new FrameLayout(this) { @Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode()==KeyEvent.KEYCODE_BACK) { // handle the back button code; return true; } return super.dispatchKeyEvent(event); } //if pressed home key, public void onCloseSystemDialogs(String reason) { //The Code Want to Perform. System.out.println("System dialog " + reason); if (reason.equals("homekey")) { // handle home button } }
}; myview = li.inflate(R.layout.my_footer, wrapper); // here set into your own layout wm.addView(myview, params);
} }
I found solution for this issue,It's working good.
public class MyFooterService extends Service{ View myview; WindowManager wm; FrameLayout wrapper; public MyFooterService() {
} @Override public void onCreate() { Log.d(TAG, "onCreate called"); LayoutInflater li = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); wm = (WindowManager) getSystemService(WINDOW_SERVICE); final WindowManager.LayoutParams params = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, 90, //height of ur layout WindowManager.LayoutParams.TYPE_PHONE, 0, PixelFormat.TRANSLUCENT);
params.gravity = Gravity.BOTTOM ; params.x = 0; params.y = 0; wrapper = new FrameLayout(this) { @Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode()==KeyEvent.KEYCODE_BACK) { // handle the back button code; return true; } return super.dispatchKeyEvent(event); } //if pressed home key, public void onCloseSystemDialogs(String reason) { //The Code Want to Perform. System.out.println("System dialog " + reason); if (reason.equals("homekey")) { // handle home button } }
}; myview = li.inflate(R.layout.my_footer, wrapper); // here set into your own layout wm.addView(myview, params);
} }

        
Present in both answers; Present only in the new answer; Present only in the old answer;