title: After open my app from service can not setText to EditText
body: <p>In my MainActivity XML file, I have an EditText which id is editsearch. I have a service class for listening to the clipboard text and open my app. Everything is happening fine but I can't set the text to my editsearch when my app opens from service class.</p>
  
  <p><code>findViewById</code> method is not work in the <code>onStartCommand</code> method of my service. I have also tried defining my editsearch EditText as a static property in my MainActivity class but not getting my expected result.</p>
  
  <p>Here is my service class</p>
  
  <pre><code>package com.learn24bd.ad;
  
  import android.app.Service;
  import android.content.ClipboardManager;
  import android.content.Context;
  import android.content.Intent;
  import android.os.IBinder;
  import android.support.annotation.Nullable;
  import android.util.Log;
  
  
  
  public class MyServiceReceiver extends Service {
      @Nullable
      @Override
      public IBinder onBind(Intent intent) {
          return null;
      }
  
      @Override
      public void onCreate() {
          super.onCreate();
      }
  
      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
          Log.i("MySerivce","Service Started");
          final ClipboardManager clipboard = (ClipboardManager) this.getSystemService(Context.CLIPBOARD_SERVICE);
          clipboard.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
              public void onPrimaryClipChanged() {
                  String copiedText = clipboard.getText().toString();
                  Log.i("Copied",copiedText);
  
                  /* here i want to setText to my editsearch
                     also tried with static property
                     MainActivity.editsearch.setText(copiedText);
                   */
  
                  Intent i = new Intent();
                  i.setClass(getApplicationContext(), MainActivity.class);
                  i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                  startActivity(i);
  
              }
          });
          return super.onStartCommand(intent, flags, startId);
      }
  
      @Override
      public void onDestroy() {
          super.onDestroy();
      }
  }
  </code></pre>