Commit 6ade800b authored by Ravishani W.M.S's avatar Ravishani W.M.S

Upload New File

parent 7d996612
package com.example.smartpillow;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import com.google.android.youtube.player.YouTubeBaseActivity;
import com.google.android.youtube.player.YouTubeInitializationResult;
import com.google.android.youtube.player.YouTubePlayer;
import com.google.android.youtube.player.YouTubePlayerView;
public class MusicTherapyT extends AppCompatActivity {
/* YouTubePlayerView youtubev1,youtubev2,youtubev3,youtubev4,youtubev5;*/
WebView web;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_music_therapy_t);
/*youtubev1 = findViewById(R.id.youtubeV1);
youtubev2 = findViewById(R.id.youtubeV2);
youtubev3 = findViewById(R.id.youtubeV3);
youtubev4 = findViewById(R.id.youtubeV4);
youtubev5 = findViewById(R.id.youtubeV5);
YouTubePlayer.OnInitializedListener listener1 = new YouTubePlayer.OnInitializedListener() {
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
youTubePlayer.loadVideo("Ho91a_GwYxs");
}
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
Toast.makeText(getApplicationContext(), "Initialization Failed", Toast.LENGTH_SHORT).show();
}
};
youtubev1.initialize("AIzaSyCsEBTaWJpEXUhwCTRcPnTlOLl7k2UnHS0",listener1);*/
web = findViewById(R.id.webview21);
WebSettings webSettings = web.getSettings();
webSettings.setJavaScriptEnabled(true);
web.setWebViewClient(new Callback());
web.loadUrl("https://smartpillo.eclick.lk/one/");
}
private class Callback extends WebViewClient {
@Override
public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
return false;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment