This error always pop up ')' expected and '}' expected The Next CEO of Stack OverflowAndroid...

Is it professional to write unrelated content in an almost-empty email?

Why am I getting "Static method cannot be referenced from a non static context: String String.valueOf(Object)"?

Yu-Gi-Oh cards in Python 3

Small nick on power cord from an electric alarm clock, and copper wiring exposed but intact

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

Players Circumventing the limitations of Wish

Expressing the idea of having a very busy time

How to Implement Deterministic Encryption Safely in .NET

What flight has the highest ratio of timezone difference to flight time?

What CSS properties can the br tag have?

Point distance program written without a framework

It is correct to match light sources with the same color temperature?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Is fine stranded wire ok for main supply line?

Is it OK to decorate a log book cover?

What would be the main consequences for a country leaving the WTO?

How to use ReplaceAll on an expression that contains a rule

Why is information "lost" when it got into a black hole?

Why did early computer designers eschew integers?

free fall ellipse or parabola?

From jafe to El-Guest

TikZ: How to fill area with a special pattern?

Reference request: Grassmannian and Plucker coordinates in type B, C, D

"Eavesdropping" vs "Listen in on"



This error always pop up ')' expected and '}' expected



The Next CEO of Stack OverflowAndroid SDK Manager and Android Studio disagree about the SDK path… What do I do?when i am using android studio getting this error “The environment variable JAVA_HOME does not point to valid jvm installation”GitHub error on new repositoryWhat is this “silent_install_wrapper.bat” program?Android Studio Lock File ErrorAndroid Studio error: java.lang.NoClassDefFoundError: net/miginfocom/layout/PlatformDefaultsError when importing a project in Android StudioAndroid Studio gives error can't run the appCopyright Profile always disappears when Rebuild or Clean the projectbuild.gradle file configuration in android studio project- splunk version error












-1















package com.example.skf;



import android.annotation.SuppressLint;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;



public class MainActivity extends AppCompatActivity {
private WebView myWebView;
private ValueCallback mUploadMessage;
private final static int FILECHOOSER_RESULTCODE=1;
public ValueCallback uploadMessage;



@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myWebView = findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("http://web1.santos.knightfrank.ph/core/");
myWebView.setWebViewClient(new WebViewClient());
myWebView.setWebChromeClient(new WebChromeClient() {

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
if (uploadMessage != null) {
uploadMessage.onReceiveValue(null);
uploadMessage = null;
}

uploadMessage = filePathCallback;

Intent intent = fileChooserParams.createIntent();
try {
startActivityForResult(intent, 100);
} catch (ActivityNotFoundException e) {
uploadMessage = null;
Toast.makeText(getApplicationContext(), "Cannot Open File Chooser", Toast.LENGTH_LONG).show();
return false;
}
return true;
}
// }

// @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

// @Override

protected void onActivityResult(int requestCode, int resultCode,
Intent intent) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (requestCode == 100) {
if (uploadMessage == null)
return;
uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
uploadMessage = null;
}
} else if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage)
return;

Uri result = ((intent == null) || (resultCode != MainActivity.RESULT_OK)) ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
} else
Toast.makeText(getApplicationContext(), "Failed to Upload Image", Toast.LENGTH_LONG).show();
}









share|improve this question







New contributor




user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    -1















    package com.example.skf;



    import android.annotation.SuppressLint;
    import android.content.ActivityNotFoundException;
    import android.content.Intent;
    import android.net.Uri;
    import android.os.Build;
    import android.os.Bundle;
    import android.support.annotation.RequiresApi;
    import android.support.v7.app.AppCompatActivity;
    import android.view.Menu;
    import android.webkit.ValueCallback;
    import android.webkit.WebChromeClient;
    import android.webkit.WebSettings;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;
    import android.widget.Toast;



    public class MainActivity extends AppCompatActivity {
    private WebView myWebView;
    private ValueCallback mUploadMessage;
    private final static int FILECHOOSER_RESULTCODE=1;
    public ValueCallback uploadMessage;



    @SuppressLint("SetJavaScriptEnabled")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    myWebView = findViewById(R.id.webView);
    WebSettings webSettings = myWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    myWebView.loadUrl("http://web1.santos.knightfrank.ph/core/");
    myWebView.setWebViewClient(new WebViewClient());
    myWebView.setWebChromeClient(new WebChromeClient() {

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
    if (uploadMessage != null) {
    uploadMessage.onReceiveValue(null);
    uploadMessage = null;
    }

    uploadMessage = filePathCallback;

    Intent intent = fileChooserParams.createIntent();
    try {
    startActivityForResult(intent, 100);
    } catch (ActivityNotFoundException e) {
    uploadMessage = null;
    Toast.makeText(getApplicationContext(), "Cannot Open File Chooser", Toast.LENGTH_LONG).show();
    return false;
    }
    return true;
    }
    // }

    // @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
    }

    // @Override

    protected void onActivityResult(int requestCode, int resultCode,
    Intent intent) {

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    if (requestCode == 100) {
    if (uploadMessage == null)
    return;
    uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
    uploadMessage = null;
    }
    } else if (requestCode == FILECHOOSER_RESULTCODE) {
    if (null == mUploadMessage)
    return;

    Uri result = ((intent == null) || (resultCode != MainActivity.RESULT_OK)) ? null : intent.getData();
    mUploadMessage.onReceiveValue(result);
    mUploadMessage = null;
    } else
    Toast.makeText(getApplicationContext(), "Failed to Upload Image", Toast.LENGTH_LONG).show();
    }









    share|improve this question







    New contributor




    user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      -1












      -1








      -1








      package com.example.skf;



      import android.annotation.SuppressLint;
      import android.content.ActivityNotFoundException;
      import android.content.Intent;
      import android.net.Uri;
      import android.os.Build;
      import android.os.Bundle;
      import android.support.annotation.RequiresApi;
      import android.support.v7.app.AppCompatActivity;
      import android.view.Menu;
      import android.webkit.ValueCallback;
      import android.webkit.WebChromeClient;
      import android.webkit.WebSettings;
      import android.webkit.WebView;
      import android.webkit.WebViewClient;
      import android.widget.Toast;



      public class MainActivity extends AppCompatActivity {
      private WebView myWebView;
      private ValueCallback mUploadMessage;
      private final static int FILECHOOSER_RESULTCODE=1;
      public ValueCallback uploadMessage;



      @SuppressLint("SetJavaScriptEnabled")
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      myWebView = findViewById(R.id.webView);
      WebSettings webSettings = myWebView.getSettings();
      webSettings.setJavaScriptEnabled(true);
      myWebView.loadUrl("http://web1.santos.knightfrank.ph/core/");
      myWebView.setWebViewClient(new WebViewClient());
      myWebView.setWebChromeClient(new WebChromeClient() {

      @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
      public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
      if (uploadMessage != null) {
      uploadMessage.onReceiveValue(null);
      uploadMessage = null;
      }

      uploadMessage = filePathCallback;

      Intent intent = fileChooserParams.createIntent();
      try {
      startActivityForResult(intent, 100);
      } catch (ActivityNotFoundException e) {
      uploadMessage = null;
      Toast.makeText(getApplicationContext(), "Cannot Open File Chooser", Toast.LENGTH_LONG).show();
      return false;
      }
      return true;
      }
      // }

      // @Override
      public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
      }

      // @Override

      protected void onActivityResult(int requestCode, int resultCode,
      Intent intent) {

      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      if (requestCode == 100) {
      if (uploadMessage == null)
      return;
      uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
      uploadMessage = null;
      }
      } else if (requestCode == FILECHOOSER_RESULTCODE) {
      if (null == mUploadMessage)
      return;

      Uri result = ((intent == null) || (resultCode != MainActivity.RESULT_OK)) ? null : intent.getData();
      mUploadMessage.onReceiveValue(result);
      mUploadMessage = null;
      } else
      Toast.makeText(getApplicationContext(), "Failed to Upload Image", Toast.LENGTH_LONG).show();
      }









      share|improve this question







      New contributor




      user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      package com.example.skf;



      import android.annotation.SuppressLint;
      import android.content.ActivityNotFoundException;
      import android.content.Intent;
      import android.net.Uri;
      import android.os.Build;
      import android.os.Bundle;
      import android.support.annotation.RequiresApi;
      import android.support.v7.app.AppCompatActivity;
      import android.view.Menu;
      import android.webkit.ValueCallback;
      import android.webkit.WebChromeClient;
      import android.webkit.WebSettings;
      import android.webkit.WebView;
      import android.webkit.WebViewClient;
      import android.widget.Toast;



      public class MainActivity extends AppCompatActivity {
      private WebView myWebView;
      private ValueCallback mUploadMessage;
      private final static int FILECHOOSER_RESULTCODE=1;
      public ValueCallback uploadMessage;



      @SuppressLint("SetJavaScriptEnabled")
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      myWebView = findViewById(R.id.webView);
      WebSettings webSettings = myWebView.getSettings();
      webSettings.setJavaScriptEnabled(true);
      myWebView.loadUrl("http://web1.santos.knightfrank.ph/core/");
      myWebView.setWebViewClient(new WebViewClient());
      myWebView.setWebChromeClient(new WebChromeClient() {

      @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
      public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) {
      if (uploadMessage != null) {
      uploadMessage.onReceiveValue(null);
      uploadMessage = null;
      }

      uploadMessage = filePathCallback;

      Intent intent = fileChooserParams.createIntent();
      try {
      startActivityForResult(intent, 100);
      } catch (ActivityNotFoundException e) {
      uploadMessage = null;
      Toast.makeText(getApplicationContext(), "Cannot Open File Chooser", Toast.LENGTH_LONG).show();
      return false;
      }
      return true;
      }
      // }

      // @Override
      public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
      }

      // @Override

      protected void onActivityResult(int requestCode, int resultCode,
      Intent intent) {

      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      if (requestCode == 100) {
      if (uploadMessage == null)
      return;
      uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
      uploadMessage = null;
      }
      } else if (requestCode == FILECHOOSER_RESULTCODE) {
      if (null == mUploadMessage)
      return;

      Uri result = ((intent == null) || (resultCode != MainActivity.RESULT_OK)) ? null : intent.getData();
      mUploadMessage.onReceiveValue(result);
      mUploadMessage = null;
      } else
      Toast.makeText(getApplicationContext(), "Failed to Upload Image", Toast.LENGTH_LONG).show();
      }






      android-studio






      share|improve this question







      New contributor




      user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 32 mins ago









      user1014849user1014849

      1




      1




      New contributor




      user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user1014849 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          user1014849 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1419784%2fthis-error-always-pop-up-expected-and-expected%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          user1014849 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          user1014849 is a new contributor. Be nice, and check out our Code of Conduct.













          user1014849 is a new contributor. Be nice, and check out our Code of Conduct.












          user1014849 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1419784%2fthis-error-always-pop-up-expected-and-expected%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...