finish()
в MainActivity
, а в AdsActivity
наоборот эти две строки удалитеIntent intent = new Intent(AdsActivity.this, MainActivity.class);
startActivity(intent);
finish()
, первую заново создавать и запускать не надо, она там в стеке будет. <queries>
<package android:name="com.facebook.katana" />
</queries>
<div class="sidebar container-fluid d-flex h-100 justify-content-center align-items-center">
<div class="row justify-content-center">
<div class="col">Колонка</div>
<div class="col">Колонка</div>
<div class="w-100"></div>
<div class="col">Колонка</div>
<div class="col">Колонка</div>
</div>
</div>
.sidebar {
position: fixed;
height: 100vh;
}
<main class="page-center">
<article class="sign-up">
<h1 class="sign-up__title">Add Faucet</h1>
<form id="data" class="sign-up-form form" action="do_addfaucets" method="post">
<label class="form-label-wrapper">
<p class="form-label">Faucet Category</p>
<select name=".num." form="data">
<?php
// Получим данные категорий
$stmt = pdo()->prepare("SELECT * FROM `categories`");
$stmt->execute();
foreach($stmt as $row){
echo "<option value=". $row["id"] ." selected>" . $row["name"] . "</option>";
}
?>
</select>
</label>
<label class="form-label-wrapper">
<p class="form-label">Faucet Name</p>
<input class="form-input" type="text" placeholder="Enter name faucet" id="name" name="name" required>
</label>
<label class="form-label-wrapper">
<p class="form-label">Faucet Url</p>
<input class="form-input" type="text" placeholder="Enter faucet url" id="url" name="url" required>
</label>
<label class="form-label-wrapper">
<p class="form-label">Faucet Time</p>
<input class="form-input" type="text" placeholder="Enter faucet time" id="time" name="time" required>
</label>
<button class="form-btn primary-default-btn transparent-btn">Add</button>
</form>
</article>
</main>
public class LoopWithStep {
int res = getSum(5, 10);
public static int getSum(int n, int step) {
int result = 0;
for (int i = 0; i <= n; i = i + step) {
result += i;
}
return result;
}
}
// включаем поддержку JavaScript
WebSettings webSettings = binding.webView.getSettings();
webSettings.setJavaScriptEnabled(true);
WebViewClient webViewClient = new WebViewClient();
binding.webView.setWebViewClient(webViewClient);
// указываем страницу загрузки
binding.webView.loadUrl("https://site.com/");
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
if ("www.example.com".equals(request.getUrl().getHost())) {
// This is my website, so do not override; let my WebView load the page
return false;
}
// Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl());
startActivity(intent);
return true;
}
}
private void gettingTotalPrice() {
binding.inputPrice.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
try {
int a = Integer.parseInt(binding.inputQuantity.getText().toString());
int b = Integer.parseInt(binding.inputPrice.getText().toString());
int res = (a * b) * 2;
binding.totalPrice.setText(String.valueOf(res));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
});
binding.inputQuantity.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
try {
int a = Integer.parseInt(binding.inputQuantity.getText().toString());
int b = Integer.parseInt(binding.inputPrice.getText().toString());
int res = (a * b) * 2;
binding.totalPrice.setText(String.valueOf(res));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
});
}
null
по той причине что ваш system_messages
находится в другом классе а именно в MainController.system_messages
из класса MainController в класс SystemMessagesController! А в самом классе получить system_messages
и подставить в замен на текст сообщения. А так же в вашем main.fxml
должен быть<Text fx:id="get_system_messages" layoutX="202.0" layoutY="638.0" strokeType="OUTSIDE" strokeWidth="0.0" text="сообщений пока нет..." wrappingWidth="889.69921875">
main.get_system_messages.setText("сюда передаём system_messages");
<activity android:name=".LoginPage">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<action android:name="android.intent.action.MAIN" />
package com.buratinoapps.imusictv;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Toast;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
public class MainActivity extends AppCompatActivity {
private long backPressedTime;
private Toast backToast;
AdView adView;
private InterstitialAd mInterstitialAd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button buttonMusicBox = findViewById(R.id.btn_music_box);
buttonMusicBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(mInterstitialAd.isLoaded()){
mInterstitialAd.show();
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdClosed(){
try{
Intent intent = new Intent(MainActivity.this, MusicBoxTv.class); startActivity(intent); finish();
} catch (Exception e){
e.printStackTrace();
}
}
});
}
else {
try {
Intent intent = new Intent(MainActivity.this, MusicBoxTv.class);
startActivity(intent);finish();
}
catch (Exception e){
}
}
}
});
Button buttonMusicTHT = findViewById(R.id.btn_tnt_music);
buttonMusicTHT.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(mInterstitialAd.isLoaded()){
mInterstitialAd.show();
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdClosed(){
try{
Intent intent = new Intent(MainActivity.this, THTMusic.class); startActivity(intent); finish();
} catch (Exception e){
e.printStackTrace();
}
}
});
}
else {
try {
Intent intent = new Intent(MainActivity.this, THTMusic.class);
startActivity(intent);finish();
}
catch (Exception e){
}
}
}
});
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});
adView = findViewById(R.id.adHomeBanner);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub-3940256099942544/1033173712");
AdRequest adRequest1 = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest1);
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
//Системная кнопка начало
@Override
public void onBackPressed() {
if(backPressedTime + 2000 > System.currentTimeMillis()){
super.onBackPressed();
return;
} else{
backToast = Toast.makeText(this, "Click again to exit", Toast.LENGTH_SHORT);
backToast.show();
}
backPressedTime = System.currentTimeMillis();
}
//Системная кнопка конец
}