• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Why don't notifications show up when I run the app?

I'm a beginner programmer and I've been working on an app that shows events and notifies the user when a new event is up.I'm trying to create a settings activity with 2 switch buttons, 1 for notifications on status bar and 1 for notification sound. When I turn on the switches, I don't get any notification nor sound.

How can I fix that?

JAVA FILE

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Switch;
import android.widget.Toast;

import androidx.annotation.RequiresApi;

import static android.icu.lang.UCharacter.GraphemeClusterBreak.V;


public class Settings extends AppCompatActivity {
Switch simpleSwitch1, simpleSwitch2;
NotificationManager manager;
Notification myNotication;
private Notification notification;

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



manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
simpleswitch1 = (Switch) findViewById(R.id.simpleswitch1);
simpleswitch2 = (Switch) findViewById(R.id.simpleswitch2);
if (simpleSwitch1.isChecked()){
simpleSwitch1.setOnClickListener(new View.OnClickListener() {

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@override
public void onClick(View arg0) {
//API level 11
Intent intent = new Intent("com.rj.notitfications.SECACTIVITY");

PendingIntent pendingIntent = PendingIntent.getActivity(Settings.this, 1, intent, 0);

Notification.Builder builder = new Notification.Builder(Settings.this);

builder.setAutoCancel(false);
builder.setTicker("this is ticker text");
builder.setContentTitle("WhatsApp Notification");
builder.setContentText("You have a new message");
builder.setSmallIcon(R.drawable.notification);
builder.setContentIntent(pendingIntent);
builder.setOngoing(true);
builder.setSubText("This is subtext..."); //API level 16
builder.setNumber(100);
builder.build();

myNotication = builder.getNotification();
manager.notify(11, myNotication);

/*
//API level 8
Notification myNotification8 = new Notification(R.drawable.ic_launcher, "this is ticker text 8", System.currentTimeMillis());

Intent intent2 = new Intent(MainActivity.this, SecActivity.class);
PendingIntent pendingIntent2 = PendingIntent.getActivity(getApplicationContext(), 2, intent2, 0);
myNotification8.setLatestEventInfo(getApplicationContext(), "API level 8", "this is api 8 msg", pendingIntent2);
manager.notify(11, myNotification8);
*/

}
});}
else{
simpleSwitch1.setOnClickListener(new View.OnClickListener() {

@override
public void onClick(View arg0) {
manager.cancel(11);
}
});
}


}




public void onClick(View v) {
simpleSwitch2 = (Switch) findViewById(R.id.simpleswitch2);
String statusSwitch2;

if (simpleSwitch2.isChecked())
notification.defaults |= Notification.DEFAULT_SOUND;




}}


XML FILE

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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=".Settings">


<TextView
android:id="@+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:text="SETTINGS"
android:textAppearance="@Style/Base.TextAppearance.AppCompat.Headline"
android:textColor="@color/design_default_color_primary_dark"
android:textColorHighlight="@color/design_default_color_primary"
android:textStyle="bold" />

<Switch
android:id="@+id/simpleswitch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView16"
android:layout_centerHorizontal="true"
android:layout_marginTop="55dp"
android:text="NOTIFICATIONS"
android:textAppearance="@Style/Base.TextAppearance.AppCompat.Large"
android:textColor="@color/colorPrimary"
android:textStyle="normal"
android:checked="true"
/>

New App: Auto Clicker - Automatic tap (Version 1.3.2)

WHAT'S NEW
- Fix some crash bugs
- Support new languages: French, Portuguese, Indonesian, Chinese, German, Arabic, ...
Special thanks to contributors :-)

EXTRA INFO
  • Rating: 4.3
  • Installs: 1,000,000+
  • Download Size: 2.9M
  • Version: 1.3.2
DESCRIPTION
Auto Clicker helps you do repeated taps at any location with any interval you specify.
Auto Clicker does NOT require root access.
Have a floating control panel to start/stop the automatic tap.
It is great for click games.

Feature:
- The friendly user interface, easy to use
- Support multiple click points, multiple swipes
- Have a global timer to run for a certain amount of time
- Can Import/Export automatic scripts

Note:
- Only support Android 7.0 and up.
- Require Accessibility service to work.

** Credits: The app icon is made by Freepik from www.flaticon.com

Install Auto Clicker now and you will be free with the automatic tap :-)

Random vibrations during phone call

Started about 3 weeks ago...I can't recall it starting after an update but can't be completely sure
try and clear cache for the phone app. if that does not work, try and put your phone in safe mode. this will prevent any third party apps from running. it will allow you to find out if another app is causing the issue. of it is still happening then the last resort would be to do a factory reset. if that does not work then you might have to go to your carrier to see if they can help resolve the issue.

Update: Sandwich! (Version 0.46.1)

WHAT'S NEW
Bug fixes + performance improvements. Thank you for playing!

EXTRA INFO
  • Rating: 4.0
  • Installs: 10,000,000+
  • Download Size: 29M
  • Version: 0.46.1
DESCRIPTION
Make delicious sandwiches by folding toppings on top of each other, and serve it on a platter to eat!

In this new, delicious puzzle game it’s your job to combine bread with lettuce, tomato, salmon, cheese, onion, and many more toppings. Unlock more ingredients as you go along and the levels get harder! Are you a true sandwich master?

Full of tricky levels, this game is set to eradicate your boredom. Oddly satisfying and deliciously entertaining! How high can you stack your sandwich? Ready, set, go!

Google play music. Et radioFM

Comment désactiver ou supprimer les applications FMtv et Google play music de mon TEL.
Merci pour votre aide
translation:
How to deactivate or delete the FMtv and Google play music applications from my TEL. Thanks for your help

just an fyi....this is an english only site.

not sure on FMtv, but any app that is part of system os can't be delete or uninstalled. you can disable it though:
https://support.google.com/googleplaymusic/answer/2521768?hl=en

New App: Randomizer (Version 2.3.3)

WHAT'S NEW
- Improved About page
- Minor improvements and bug fixes

Don't forget to rate the app! Your feedback is valuable.

EXTRA INFO
  • Rating: 4.8
  • Installs: 10,000+
  • Download Size: Varies with device
  • Version: 2.3.3
DESCRIPTION
Randomizer is a simple app for generating random values.

Features:
- Generate random numbers in a specified range.
- Flip coins.
- Enter (and save) your own custom lists and pick random elements from them.
- Dark theme support.
- Advanced random number generation algorithm.
- Create secure, customizable, random passwords for your accounts.
- Roll one or more dice.
- Shake the device instead of using the buttons.
- Get random letters in various languages.
- Generate random colours in various formats.
- Generate random countries and learn more about them.
- Generate random dates and times.
- Get random chemical elements and read the corresponding Wikipedia articles.

Randomizer is entirely free. No ads, no unnecessary permissions.

Join the beta program: https://play.google.com/apps/testing/com.giannis.randomizer

New App: Spin The Wheel - Random Picker (Version 2.3.2)

WHAT'S NEW
Chatrooms - you can now chat with other people spinning the same wheel and see other users' spin results!
Search - you can now search the Wheel Store for wheels.
Performance - improved app performance while spinning wheels.

EXTRA INFO
  • Rating: 4.6
  • Installs: 1,000,000+
  • Download Size: 13M
  • Version: 2.3.2
DESCRIPTION
Having a hard time deciding something? Let us help you decide in a fun way!

Spin The Wheel - Random Picker is an ultimate decision making fortune wheel app where you can create countless custom wheels of fortune, add as many customized labels as you want and spin away!

Put anything you want on the wheel and make unique raffle pickers, random name pickers to draw names of prize winners, create your own spinner games which are much more fun than just flipping a coin or make unlimited lucky wheels to help you answer such questions as What should I do? Where should I eat? Where should I go? Make your decisions in a fun way!

Some of the many great features you get for free:
&gt; Chatrooms! Chat with other people who are currently spinning the same wheel of fortune as you and see their spin results.
&gt; Premade presets to easily create beautiful spinner wheels
&gt; A wheel store with hundreds of user-made wheels
&gt; Unlimited wheels of fortune
&gt; Unlimited labels on every wheel
&gt; Customizable text and background of each label, choosing from dozens of colors
&gt; Easily share your wheels and spin results with friends
&gt; Quickly disable and re-enable wheel labels as needed
&gt; Random result every time, no matter how hard the wheel was spun

If you want to have fun doing your raffle, giveaway or picking random name for a game then this app is exactly what you want to have!

In the Spin The Wheel - Random Picker the result is mathematically calculated and chosen randomly every time you spin the wheel, no matter how hard or easy the wheel was spun.

Which mobile I must buy

It is normal use YouTube intstgram Twitter I want mobile good not after 6 month or 1 year have problem in charging not charge or slow or stop work.
Honestly pretty much any phone will handle this usage.

Just don't buy cheap junk or a phone that is so old that a "new" phone means it's sat in a warehouse for two years (because that's bad for the battery).

How To How To Take A Screenshot

The best way to take a screenshot on the Galaxy S20 Ultra:
  1. Press the Side Button and Volume Down Button simultaneously
  2. Select from the pop up option for advanced features:
    • Tap the circular "Image Avatar" to open the screenshot immediately
    • Tap the "Smart Capture" icon to take a scrolling screenshot that captures more of the page
    • Tap the "Crop/Pencil" icon to edit and write on the image
    • Tap the "Hashtag" icon to label the screenshot for organization
    • Tap the "Share" icon to open or share the screenshot in another app
  3. If you press nothing and wait several seconds the screenshot will be saved to your gallery and the dialogue box will disappear.
You can also take a screenshot with a gesture called "Palm Swipe":
  • Enable in Settings > Advanced features > Motion and gestures > Palm swipe to capture
  • Navigate to the screen you want to capture
  • With the edge of your palm (like a karate chop) swipe from the left edge of your screen to the right edge of your screen (like a windshield wiper). Yes, you should be touching the screen.
Less popular methods of taking a screenshot:
There are a few less popular ways to take a screenshot on the S20 Ultra, but they exist nonetheless:
  • Launch Bixby and say "Take a screenshot"
  • Launch Google Assistant and say "Okay Google, Take a Screenshot"
  • Enable "Edge Panels" in "Settings > Display > Edge screen > Edge panels" and select "Smart Select" from your Edge Panel.
Did this help you? Do you have any questions? What's your favorite method of taking screenshots?

Included Screen Protector

My S20+ shipped from Samsung with a screen protector already mounted. I'm having trouble seeing the screen when wearing polarized sunglasses. Am wondering if this is caused by the screen protector or is it the screen itself? I'd like to know if it's a screen issue before needlessly removing the screen protector.

Anyone take their screen protector yet & notice a difference when wearing polarized sunglasses?

TIA.

So unfortunately this is a common problem with smart phones. Should have nothing to do with screen protector.

Turn phone sideways and it *should* go away. Funnily enough, on my Pixel 3 the screen only worked when I held it normal, and I couldn't see when sideways, only phone that ever did that. I need to check this on my S20 because the only time I care is flying my drone. I literally couldn't do it with Pixel and wear sunglasses, SUPER aggravating.

Try it sideways and let us know!

Here is a quick wexplanation:
Most phones have a polarizing filter that helps to cut glare and reflections, ironically to make it easier to see in bright sunlight. The problem is, so do polarized sunglasses. When your phone and sunglass filters are aligned in opposite directions, all the light from your screen is cut out so you can't see anything.

Update: Messenger Lite: Free Calls & Messages (Version 80.0.1.6.238)

EXTRA INFO
  • Rating: 4.3
  • Installs: 500,000,000+
  • Download Size: Varies with device
  • Version: 80.0.1.6.238
DESCRIPTION
A fast and data-efficient messaging app to reach the people in your life.

Messenger Lite:
- Installs quickly. It's less than 10MB to download!
- Saves data. It loads fast, runs efficiently and uses less mobile data.
- Works everywhere. Reach people when you're in an area with a slow or unstable internet connection.

With Messenger Lite, you can:
- Contact anyone on Messenger, Facebook or Facebook Lite.
- See when people are active and available to chat.
- Message people one-on-one or in groups to catch up or make plans.
- Send photos, links, or express yourself with stickers.
- Make one-on-one voice and video calls for free over Wi-Fi (otherwise standard data charges apply). Talk as long as you want, even with people in other countries!

AsyncTask and Looper

Hello, i'm Mark and i'm writing from Italy.
I have a problem with my application, because at Runtime i have an Exception.
The structure of the project is this:
MainActivity.java->workActivity.java that contains also myClass1 that extends AsyncTask .
In the project i have another class called GetData that contains variable and other methods for Database.

So if i click a button in workActivity then i generate:

myClass1 asyncT = new myClass1 ();
asyncT .execute("");

So the code jump in myClass1 where i have:

public class taskRicercaRicambio extends AsyncTask<String, String, Boolean>
//variable
private GetData getData;
private int counter;
private List<myType> myList;

@override
protected void onPreExecute() {
super.onPreExecute();
// instruction for GUI thread...like progressDialog...}

@override
protected Boolean doInBackground(String... strings) {
int counter = 0;
myList = new LinkedList<myType>();
getData = new GetData(); // THIS LINE CAUSE EXCEPTION
Thread t1 = new Thread(new Runnable() {
@override
public void run() {
Thread.currentThread().setName("myName");
//... other instruction...
});
t1.start();
try {
t1.join(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
if(t1.isAlive()){
t1.interrupt();
}
return true;
}

@override
protected void onPostExecute(Boolean s) {
//..do something with UI thread.......}

Why this line getData = new GetData(); give me an exception ?
If i put it in onPreExecute() method all work perfectly. No error.
But if not, i want to understand why the debugger show me :
java.lang.RuntimeException: Can't create handler inside thread Thread[AsyncTask #2,5,main] that has not called Looper.prepare()

Why i cannot instatiate an object of GetData Class in the background method ?
Why is asking me for a looper ? I haven't any GUI component to update.


UPDATE
I found the bug.
In the doInBackground method i create a GetData object, but inside the constructor of GetData i create another object of type myClassBug and this class extends AppCompatActivity.
As soon as i delete the extends, all works ok.

I couldn't understand why he asked me a Looper if I don't have to update the UI... I suppose it's for this reason.
Hope this helps other user !

How To How to Turn Off the Galaxy S20 Ultra

There are 4 ways to turn off the Samsung Galaxy S20 Ultra.

The easiest way to turn off the Galaxy S20 Ultra:

  • Press and hold the side button and volume down button for 3 seconds
  • Select either "Power Off" or "Restart"
The most popular way to turn off the Galaxy S20 Ultra:
Most people don't like how the "Power Button" launches Bixby when they first use their phone. They want the "Side Key" to launch the traditional Power Menu when they press and hold. If you would prefer to turn your Galaxy S20 Ultra off by pressing and holding ONLY the side button, you can change the Bixby button to do just that:
  • Press and hold the side button and volume down button for 3 seconds
  • Press the "Side Key Settings" button at the bottom
  • From the "Press and hold" section select "Power off menu"
  • You can now press and hold the side key to turn off the S20 Ultra
You can also access these Side Key Settings through the full device settings:
Settings > Advanced Feature > Side Key

Turn off your phone with your voice:
You can also turn off your phone with your voice using Bixby:
  • Wake Bixby by pressing and holding the Side Key
  • Keep holding the Side Key and say, "Turn off the phone"
  • Release the button when you're finished speaking
If you've changed your Side Key settings, use whatever method you've selected to launch Bixby (such as double pressing the side key).

Turn off your phone from Quick Settings:
Samsung has also included a "Power Off" option in the notification shade:
  • Swipe down from the top of the screen
  • Tap the power button in the top right corner
  • Select "Power Off" or "Restart"
There you have it- all 4 methods to turn off the Galaxy S20 Ultra! And to turn the device back on you simply press and hold the Side Key (in case you were wondering).

Filter

Back
Top Bottom