Комментарии:
thank you for this tutorial!
i have a question: how to add a badge if the app receives an FCM data type notification? (and the app stat is in the background or killed)
Thank You
ОтветитьThe 50dp in app:cardCornerRadius="50dp" is overkill. 9dp will suffice.
ОтветитьHy can you help me
Ответитьthe card to display number is not displaying color
Ответитьgreat work
ОтветитьI have a question is there any other way to add notification counter badge in the imageview? or this is the only way?
ОтветитьCan i ask you two more questions. I had design my application for church liturgy on PlayStore but i don't have any database. I wrote all of them on strings.
1. How can i insert the (liturgy) "words" In to database. ?
2. How to display notifications when there is a new the liturgy or information for user.
Where should i start. Please kindly give you're link or tutorial video related to my questions.
Plz.. make a video on add to cart
Ответитьhahaha you forced me to change my linear layout to constraint layout. i learned quite a bit :)
ОтветитьI want to place button in one activity and notification counter toolbar in another activity.but when button click counter not incrementing
Ответитьplease share this code please ..
Ответитьthanks for the video
Ответитьreally i love you sir
ОтветитьThanks
Ответитьpackage com.example.page1;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
private Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button =(Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openpage2();
}
});
}
public void openpage2()
{
Intent intent = new Intent(this, page2.class);
startActivity(intent);
}
}
2
--
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button dispyBtn = findViewById(R.id.displyBtn);
Bundle b1 = getIntent().getExtras();
String s =b1.getString("name");
dispyBtn.setText(s);
implicit email
public class MainActivity extends AppCompatActivity {
private EditText mEditTextTo;
private EditText mEditTextSubject;
private EditText mEditTextMessage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mEditTextTo = findViewById(R.id.edit_text_to);
mEditTextSubject = findViewById(R.id.edit_text_subject);
mEditTextMessage = findViewById(R.id.edit_text_message);
Button buttonSend = findViewById(R.id.button_send);
buttonSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendMail();
}
});
}
private void sendMail() {
String recipientList = mEditTextTo.getText().toString();
String[] recipients = recipientList.split(",");
String subject = mEditTextSubject.getText().toString();
String message = mEditTextMessage.getText().toString();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, recipients);
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, message);
intent.setType("message/rfc822");
startActivity(Intent.createChooser(intent, "Choose an email client"));
}
}
----------------------------------------------------------------------------
shared prafrance
================
package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.SharedPreferences;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private int mcount = 0;
private TextView countntertextview;
private SharedPreferences preferences;
private String prefile = "com.example.myapplication";
private int mcolor;
private String counter_key = "counter";
private String color_key = "color";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
countntertextview = findViewById(R.id.count_textview);
preferences = getSharedPreferences(prefile,MODE_PRIVATE);
mcount = preferences.getInt(counter_key, 0);
mcolor = preferences.getInt(color_key, R.color.default_background);
countntertextview.setText(String.valueOf(mcount));
countntertextview.setBackgroundColor(mcolor);
}
@Override
protected void onPause() {
super.onPause();
SharedPreferences.Editor editor = preferences.edit();
editor.putInt(counter_key,mcount);
editor.putInt(color_key,mcolor);
editor.apply();
}
public void changeBackground(View view) {
int color = ((ColorDrawable)view.getBackground()).getColor();
countntertextview.setBackgroundColor(color);
mcolor = color;
}
public void countUp(View view) {
mcount ++;
countntertextview.setText(String.valueOf(mcount));
}
public void reset(View view) {
mcount = 0;
mcolor =R.color.default_background;
countntertextview.setText(String.valueOf(mcount));
countntertextview.setBackgroundColor(mcolor); }
}
intent
------
package com.example.section4v1;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import org.w3c.dom.Text;
public class MainActivity extends AppCompatActivity {
//reference
int q = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button dispyBtn = findViewById(R.id.displyBtn);
Button plusBtn = findViewById(R.id.incrementBtn);
Button minusBtn = findViewById(R.id.decBtn);
Button sendBtn = findViewById(R.id.sndBtn);
sendBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
gotToSecondActivty();
}
});
//listnere
dispyBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
displyName();
displyLoc();
}
});
plusBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
increment();
displayQ();
}
});
minusBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
decrement ();
displayQ();
}
});
}
//
private void increment () {
q++;
}
private void decrement () {
q--;
}
// disply
private void displayQ () {
TextView qTxtview = findViewById(R.id.qunityTxtview);
qTxtview.setText(String.valueOf(q));
}
private void displyName () {
TextView nameDislyTtview = findViewById(R.id.displyNameTxtview);
EditText nameEdiTxt = findViewById(R.id.nameEditText);
String name = nameEdiTxt.getText().toString();
nameDislyTtview.setText(name);
}
private void displyLoc () {
String loc = " ";
RadioButton caiorRadioBtn = findViewById(R.id.cairoRadioBtn);
RadioButton alexRadioBtn = findViewById(R.id.alexRadioBtn);
TextView locDoisplyTextView = findViewById(R.id.displyLocationTxtview);
if (caiorRadioBtn.isChecked()) {
loc = "Caior";
}else if (alexRadioBtn.isChecked()){
loc = "alex";
}else {
loc = "you naeed to selcte one";
}
locDoisplyTextView.setText(loc.toString());
}
public void gotToSecondActivty () {
Intent gotTonextActivty = new Intent(this , SecondActivity.class);
startActivity(gotTonextActivty);
}
}
Very nice . New subscriber 👌
Please upload videos regular
👍👍👍👍👍👍
Finally i got video on notifications....
But still waiting for videos on database..
I want video tutorial of payment system in app
Ответить