New App: StopMarker - arrival signal (Version 1.2)
- By App Update
- Apps & Games
- 0 Replies
EXTRA INFO
- Rating: 4.9
- Installs: 0+
- Download Size: 1.5M
- Version: 1.2
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.nav_facebook:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new FacebookFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_twitter:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new TwitterFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_instagram:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new InstagramFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_linkedin:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new LinkedinFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_snapchat:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new SnapchatFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_pinterest:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new PinterestFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_youtube:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new YoutubeFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_about:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new AboutFragment()).addToBackStack("tag").commit();
break;
case R.id.nav_privacy:
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,
new PrivacyFragment()).addToBackStack("tag").commit();
break;
}
drawer.closeDrawer(GravityCompat.START);
return true;
}
@Override
public void onBackPressed() {
FragmentManager fm = getSupportFragmentManager();
if (fm.getBackStackEntryCount() > 0) {
fm.popBackStack();
} else {
super.onBackPressed();
}
}
public class FacebookFragment extends Fragment {
public FacebookFragment() {
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_facebook, container, false);
WebView webView = (WebView)v.findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://www.facebook.com/");
return v;
}
}
package com.example.lilaccottagebell
import android.app.NotificationChannel
import android.app.NotificationManager
import android.os.Build
import android.os.Bundle
import android.webkit.WebResourceError
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Create the NotificationChannel
val name = getString(R.string.channel_name)
val descriptionText = getString(R.string.channel_description)
val importance = NotificationManager.IMPORTANCE_DEFAULT
val CHANNEL_ID = "only_channel"
val mChannel = NotificationChannel(CHANNEL_ID, name, importance)
mChannel.description = descriptionText
// Register the channel with the system; you can't change the importance
// or other notification behaviors after this
val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(mChannel)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Create channel to show notifications.
val channelId = getString(R.string.default_notification_channel_id)
val channelName = getString(R.string.default_notification_channel_name)
val notificationManager = getSystemService(NotificationManager::class.java)
notificationManager?.createNotificationChannel(NotificationChannel(channelId,
channelName, NotificationManager.IMPORTANCE_HIGH))
}
// If a notification message is tapped, any data accompanying the notification
// message is available in the intent extras. In this sample the launcher
// intent is fired when the notification is tapped, so any accompanying data would
// be handled here. If you want a different intent fired, set the click_action
// field of the notification message to the desired intent. The launcher intent
// is used when no click_action is specified.
//
// Handle possible data accompanying notification message.
// [START handle_data_extras]
// [END handle_data_extras]
val myWebView: WebView = findViewById(R.id.webview)
/*myWebView.loadUrl("https://amazon.co.uk")*/
myWebView.webViewClient = WebViewClient()
WebView.setWebContentsDebuggingEnabled(true)
/*5 March 2021*/
myWebView.clearCache(true)
myWebView.loadUrl("http://192.168.1.144/apikey/webcam")
val disable_button: Button = findViewById(R.id.disable)
disable_button.setOnClickListener {
myWebView.loadUrl("http://192.168.1.144/apikey/disable")
}
fun onReceivedError(
view: WebView,
request: WebResourceRequest,
error: WebResourceError
) {
Toast.makeText(this, "Webcam not reachable", Toast.LENGTH_SHORT).show()
}
}
}