Eingabe während die App läuft unterbinden

  • 5 Antworten
  • Letztes Antwortdatum
Status
Dieses Thema wurde gelöst! Zur Lösung springen…
H

heikoj10.1

Neues Mitglied
4
Hallo,

bei mir erscheint, wenn man auf den Bildschirm drückt, während meine App läuft immer die Tastatur. Wie kann ich das unterbinden? Eigentlich gibt es nichts zum Eingeben.

Vielen Dank für Eure Hilfe schon mal im Voraus!
 
Empfohlene Antwort(en)
Hallo in dem Layout hast du einen EditText in Java Code einen Textview ändere das im Layout.
 
  • Danke
Reaktionen: heikoj10.1 und swa00
Alle Antworten (5)
Hallo,

hier mal ein Ausschnitt aus der Quelle in der die Tastatur auf geht und nicht mehr aufgehen soll.

Meine Quellen:
public class Serie extends Activity implements View.OnClickListener {

Button btnAbruch;
TextView tvAnzeige;
Timer timer;
TimerTask task;
int pause, halten, wiederholungen, coutdownzeit;
CountDownTimer myCountdowntimer;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_serie);

tvAnzeige = (TextView) findViewById(R.id.tvAnzeige);
btnAbruch = (Button) findViewById(R.id.btnAbbruch);
btnAbruch.setOnClickListener(this);

Bundle extras = getIntent().getExtras();
pause = extras.getInt("Pause");
halten = extras.getInt("Halten");
wiederholungen = extras.getInt("Wiederholungen");

// Funktionsaufruf
functionWarten(pause);
}


@override
public void onClick(View v) {
Intent intent;
intent = new Intent(this, MainActivity.class);
startActivity(intent);
this.finish();
}



// Funktion Deklaration
private void functionWarten(int zeit) {
new CountDownTimer(zeit * 1000, 1000) {
@override
public void onTick(long millisUntilFinished) {
tvAnzeige.setBackgroundColor(Color.GREEN);
tvAnzeige.setText("" + millisUntilFinished / 1000);
}

@override
public void onFinish() {
tvAnzeige.setText("Fertig!");
tvAnzeige.setBackgroundColor(Color.RED);
}
}.start();
}
}


Und hier noch das xml dazu:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Serie">

<EditText
android:id="@+id/tvAnzeige"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="15dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="13dp"
android:background="@color/colorPrimary"
android:ems="10"
android:foregroundGravity="center|center_horizontal"
android:gravity="center|center_vertical"
android:inputType="time"
android:textSize="100sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />

<Button
android:id="@+id/btnAbbruch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="108dp"
android:text="Abbrechen"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>



Und dann noch eine andere Frage, wie kann ich die Quellen richtig einfügen?
 
Hallo in dem Layout hast du einen EditText in Java Code einen Textview ändere das im Layout.
 
  • Danke
Reaktionen: heikoj10.1 und swa00
Eigentlich gibt es nichts zum Eingeben.

Aber du gibst eigenständig in deinem Layout an , dass ein EditText verwendet werden soll.
Also reagiert deine App richtig .
 
  • Danke
Reaktionen: heikoj10.1 und jogimuc
Hallo, das war´s es hat geklappt. Vielen Dank für die schnelle Hilfe
 
Status
Dieses Thema wurde gelöst! Zur Lösung springen…

Ähnliche Themen

G
Antworten
0
Aufrufe
91
Gerdchen07
G
G
Antworten
1
Aufrufe
345
Gerdchen07
G
G
Antworten
13
Aufrufe
547
Gerdchen07
G
L
Antworten
1
Aufrufe
393
swa00
swa00
migi01
Antworten
26
Aufrufe
1.857
migi01
migi01
Zurück
Oben Unten