Item is disappearing from list in android - android

I have an listview of SMSItem objects . When any new sms arrives , it is showed in the list . But after clicking the list or if the activity is relaunched , the item is disappearing . The item is not showed in the list .
My manifest file is as follows :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commlink.smscheck"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="20" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SmsActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".SmsBroadcastReceiver"
android:exported="true" >
<intent-filter android:priority="999" >
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<activity
android:name=".ShowIndividualSMS"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name=".SmsReceiver"
android:permission="android.permission.BROADCAST_SMS">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_DELIVER" />
</intent-filter>
</receiver>
<!-- BroadcastReceiver that listens for incoming MMS messages -->
<receiver android:name=".MmsReceiver"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
<!-- Activity that allows the user to send new SMS/MMS messages -->
<activity android:name=".ComposeSmsActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</activity>
<!-- Service that delivers messages from the phone "quick response" -->
<service android:name=".HeadlessSmsSendService"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</service>
</application>
</manifest>
If the menifest file is as follows , then the item in list is not disappearing . But the app is not set as default .
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commlink.smscheck"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="20" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SmsActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".SmsBroadcastReceiver"
android:exported="true" >
<intent-filter android:priority="999" >
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<activity
android:name=".ShowIndividualSMS"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- BroadcastReceiver that listens for incoming MMS messages -->
<receiver android:name=".MmsReceiver"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
<!-- Activity that allows the user to send new SMS/MMS messages -->
<activity android:name=".ComposeSmsActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</activity>
<!-- Service that delivers messages from the phone "quick response" -->
<service android:name=".HeadlessSmsSendService"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</service>
</application>
</manifest>
Where is the problem . How can I solve this?
The code of the adapter is as follows :
public class SmsArrayAdapter extends ArrayAdapter<SMSItem> {
List<SMSItem> smsBody;
Context context;
private static LayoutInflater inflater = null;
String fromNumber;
public SmsArrayAdapter(Context context, int resource,
List<SMSItem> smsBody, String fromNumber) {
super(context, resource, smsBody);
this.smsBody = smsBody;
this.context = context;
inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.fromNumber = fromNumber;
}
public SMSItem getStr(int position) {
return smsBody.get(position);
}
public void setRead(int position, String smsMessageId) {
smsBody.get(position).status = true;
SMSItem smsItem = smsBody.get(position);
smsItem.status = true;
//smsBody.set(position, smsItem);
ContentValues values = new ContentValues();
values.put("read",true);
int flag = context.getContentResolver().update(Uri.parse("content://sms/inbox"),
values, "_id=" + smsMessageId, null);
Toast.makeText(context, "The result is "+flag, Toast.LENGTH_LONG).show();
/* Uri uri = Uri.parse("content://sms/inbox");
String selection = "address = ? AND body = ? AND read = ?";
String from = "03590000004";
String body =smsItem.sms;
String[] selectionArgs = {from, body, "0"};
ContentValues values = new ContentValues();
values.put("read", true);
int flag = context.getContentResolver().update(uri, values, selection, selectionArgs);
Toast.makeText(context, "The result is "+flag, Toast.LENGTH_LONG).show(); */
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return super.getCount();
}
#Override
public SMSItem getItem(int position) {
// TODO Auto-generated method stub
return smsBody.get(position);
}
public static class ViewHolder {
public TextView textfrom;
public TextView text_sms;
public TextView text_time;
}
#Override
public View getView(int position, View convertView, ViewGroup parent) {
// Toast.makeText(context, "The index is "+position, Toast.LENGTH_LONG).show();
ViewHolder holder;
if (convertView == null) {
/****** Inflate tabitem.xml file for each row ( Defined below ) *******/
convertView = inflater.inflate(R.layout.row_item, null);
/****** View Holder Object to contain tabitem.xml file elements ******/
holder = new ViewHolder();
holder.textfrom = (TextView) convertView
.findViewById(R.id.textView_from);
holder.text_sms = (TextView) convertView
.findViewById(R.id.textView_sms);
holder.text_time = (TextView) convertView
.findViewById(R.id.textView_time);
/************ Set holder with LayoutInflater ************/
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.textfrom.setText(" " + fromNumber);
SMSItem smsItem = smsBody.get(position);
String smsTextToDisplay = smsItem.sms;
if (smsTextToDisplay.length() > 100)
smsTextToDisplay = smsTextToDisplay.substring(0, 99) + " ...";
holder.text_sms.setText(smsTextToDisplay);
holder.text_time.setText(smsItem.time);
if (smsItem.status == false) {
convertView.setBackgroundColor(context.getResources().getColor(
R.color.light_blue_overlay));
}
else
{
convertView.setBackgroundColor(Color.WHITE);
}
return convertView;
}
}

Related

Security Exception App.Utils.getDeviceSerial Error. How to fix it?

I will make the file sharing android app like share it and xender.
but my app users face some problems in my app. and in google play console error section it shows Security Exception App.Utils.getDeviceSerial Error.
I am try to find the error but I can not able to find the error.
please help to find the issue in my coding.
This is my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.genonbeta.TrebleShot">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name="com.IApps.IndianShareIt.App"
android:allowBackup="true"
android:appComponentFactory="#string/app_name"
android:fullBackupContent="true"
android:icon="#drawable/ic_trebleshot_original_white_128dp"
android:label="#string/text_appName"
android:supportsRtl="true"
android:theme="#style/Theme.TrebleShot"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:appComponentFactory">
<activity android:name="com.IApps.IndianShareIt.activity.WebView"
android:screenOrientation="locked"
android:theme="#style/Theme.Design.Light.NoActionBar"/>
<activity
android:name="com.IApps.IndianShareIt.activity.HomeActivity"
android:label="#string/text_appName"
android:launchMode="singleTask"
android:screenOrientation="locked"
android:theme="#style/Theme.TrebleShot.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.IApps.IndianShareIt.activity.ShareActivity"
android:label="#string/text_appName"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar">
<intent-filter>
<action android:name="genonbeta.intent.action.TREBLESHOT_SEND_TEXT" />
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<action android:name="genonbeta.intent.action.TREBLESHOT_SEND" />
<action android:name="genonbeta.intent.action.TREBLESHOT_SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
<!--
<meta-data
android:name="android.service.chooser.chooser_target_service"
android:value=".service.DeviceChooserService" />
-->
</activity>
<activity
android:name="com.IApps.IndianShareIt.activity.AddDevicesToTransferActivity"
android:label="#string/text_addDevicesToTransfer"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar" />
<activity
android:name="com.IApps.IndianShareIt.activity.FileExplorerActivity"
android:label="#string/text_fileExplorer"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar" />
<activity
android:name="com.IApps.IndianShareIt.activity.TextStreamActivity"
android:label="#string/text_textStream"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar" />
<activity
android:name="com.IApps.IndianShareIt.activity.ConnectionManagerActivity"
android:label="#string/text_connectDevices"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar" />
<activity
android:name="com.IApps.IndianShareIt.activity.ContentSharingActivity"
android:label="#string/text_send"
android:launchMode="singleTask"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar" />
<activity
android:name="com.IApps.IndianShareIt.activity.FilePickerActivity"
android:label="#string/text_fileExplorer" />
<activity
android:name="com.IApps.IndianShareIt.activity.ViewTransferActivity"
android:label="#string/text_transactionViewer"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:host="*" />
<!-- expected file name pattern .5435-4543-4354-ewrw.tshare -->
<data android:pathPattern=".*\\.tshare" />
<data android:pathPattern=".*\\..*\\.tshare" />
</intent-filter>
</activity>
<activity
android:name="com.IApps.IndianShareIt.activity.ManageDevicesActivity"
android:label="#string/text_manageDevices" />
<activity
android:name="com.IApps.IndianShareIt.activity.SearchActivity"
android:label="#string/butn_search" />
<activity
android:name="com.IApps.IndianShareIt.activity.PreferencesActivity"
android:label="#string/text_preferences" />
<activity
android:name="com.IApps.IndianShareIt.activity.TextEditorActivity"
android:label="#string/text_textEditor" />
<activity
android:name="com.IApps.IndianShareIt.activity.ChangeStoragePathActivity"
android:theme="#style/Base.Theme.AppCompat.Dialog">
<intent-filter>
<action android:name="com.genonbeta.intent.action.UPDATE_STORAGE_PATH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.IApps.IndianShareIt.activity.ThirdPartyLibrariesActivity"
android:label="#string/text_thirdPartyLibraries" />
<activity
android:name="com.IApps.IndianShareIt.activity.ChangelogActivity"
android:label="#string/text_changelog" /> <!-- todo: Remember, we are always using dark theme for this for better effects -->
<activity
android:name="com.IApps.IndianShareIt.activity.BarcodeScannerActivity"
android:label="#string/text_scanQrCode"
android:theme="#style/Theme.TrebleShot.BarcodeScannerActivity" />
<activity
android:name="com.IApps.IndianShareIt.activity.WelcomeActivity"
android:label="#string/text_welcome"
android:theme="#style/Theme.TrebleShot.NoActionBar" />
<activity
android:name="com.IApps.IndianShareIt.activity.WebShareActivity"
android:label="#string/text_webShare"
android:theme="#style/Theme.TrebleShot.NoActionBar.StaticStatusBar" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths" />
</provider>
<receiver
android:name="com.IApps.IndianShareIt.receiver.NetworkStatusReceiver"
android:process=":transfer">
<intent-filter>
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="android.net.wifi.WIFI_AP_STATE_CHANGED" />
<action android:name="android.net.wifi.STATE_CHANGE" />
<action android:name="android.net.wifi.p2p.CONNECTION_STATE_CHANGE" />
</intent-filter>
</receiver>
<receiver
android:name="com.IApps.IndianShareIt.receiver.DialogEventReceiver"
android:process=":transfer" />
<service
android:name="com.IApps.IndianShareIt.service.CommunicationService"
android:enabled="true"
android:label="#string/text_communicationService"
android:process=":transfer" />
<service
android:name="com.IApps.IndianShareIt.service.DeviceChooserService"
android:label="#string/text_chooserTargetService"
android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
<intent-filter>
<action android:name="android.service.chooser.ChooserTargetService" />
</intent-filter>
</service>
<service android:name="com.IApps.IndianShareIt.service.DeviceScannerService">
<intent-filter>
<action android:name="genonbeta.intent.action.SCAN_DEVICES" />
<action android:name="genonbeta.intent.action.ADD_IP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service
android:name="com.IApps.IndianShareIt.service.WorkerService"
android:label="#string/text_workerService" />
<service
android:name="com.IApps.IndianShareIt.service.CommunicationToggleTile"
android:icon="#drawable/ic_trebleshot_white_24dp_static"
android:label="#string/text_shareFiles"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:process=":transfer">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
<!-- sample - ca-app-pub-3940256099942544~3347511713-->
<!-- main - ca-app-pub-2802607728843215~8939176355-->
</application>
</manifest>
and this is my welcome activity with permissions
public class WelcomeActivity extends Activity
{
public final static String TAG = WelcomeActivity.class.getSimpleName();
private ViewGroup mSplashView;
private ViewGroup mProfileView;
private ViewGroup mPermissionsView;
#Override
protected void onCreate(#Nullable Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome);
setSkipPermissionRequest(true);
setWelcomePageDisallowed(true);
final FloatingActionButton nextButton = findViewById(R.id.activity_welcome_view_next);
final AppCompatImageView previousButton = findViewById(R.id.activity_welcome_view_previous);
final ProgressBar progressBar = findViewById(R.id.activity_welcome_progress_bar);
final ViewPager viewPager = findViewById(R.id.activity_welcome_view_pager);
final DynamicViewPagerAdapter pagerAdapter = new DynamicViewPagerAdapter();
{
#ColorInt
int appliedColor = ContextCompat.getColor(this, AppUtils.getReference(this, R.attr.colorSecondary));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Drawable wrapDrawable = DrawableCompat.wrap(progressBar.getProgressDrawable());
DrawableCompat.setTint(wrapDrawable, appliedColor);
progressBar.setProgressDrawable(DrawableCompat.unwrap(wrapDrawable));
} else
progressBar.setProgressTintList(ColorStateList.valueOf(appliedColor));
}
{
mSplashView = (ViewGroup) getLayoutInflater().inflate(R.layout.layout_welcome_page_1, null, false);
pagerAdapter.addView(mSplashView);
}
if (Build.VERSION.SDK_INT >= 23) {
mPermissionsView = (ViewGroup) getLayoutInflater().inflate(R.layout.layout_welcome_page_3, null, false);
pagerAdapter.addView(mPermissionsView);
checkPermissionsState();
mPermissionsView.findViewById(R.id.layout_welcome_page_3_request_button)
.setOnClickListener(new View.OnClickListener()
{
#Override
public void onClick(View v)
{
requestRequiredPermissions(false);
}
});
}
{
mProfileView = (ViewGroup) getLayoutInflater().inflate(R.layout.layout_welcome_page_2, null, false);
pagerAdapter.addView(mProfileView);
setUserProfile();
}
pagerAdapter.addView(getLayoutInflater().inflate(R.layout.layout_welcome_page_4, null, false));
{
View view = getLayoutInflater().inflate(R.layout.layout_welcome_page_5, null, false);
AlphaAnimation alphaAnimation = new AlphaAnimation(0.3f, 1.0f);
alphaAnimation.setDuration(2000);
alphaAnimation.setRepeatCount(Animation.INFINITE);
alphaAnimation.setRepeatMode(Animation.REVERSE);
view.findViewById(R.id.layout_welcome_page_5_text)
.setAnimation(alphaAnimation);
pagerAdapter.addView(view);
}
progressBar.setMax((pagerAdapter.getCount() - 1) * 100);
previousButton.setOnClickListener(new View.OnClickListener()
{
#Override
public void onClick(View v)
{
if (viewPager.getCurrentItem() - 1 >= 0)
viewPager.setCurrentItem(viewPager.getCurrentItem() - 1, true);
}
});
nextButton.setOnClickListener(new View.OnClickListener()
{
#Override
public void onClick(View v)
{
if (viewPager.getCurrentItem() + 1 < pagerAdapter.getCount())
viewPager.setCurrentItem(viewPager.getCurrentItem() + 1);
else {
// end presentation
getDefaultPreferences().edit()
.putBoolean("introduction_shown", true)
.apply();
startActivity(new Intent(WelcomeActivity.this, HomeActivity.class));
finish();
}
}
});
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener()
{
#Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
{
progressBar.setProgress((position * 100) + (int) (positionOffset * 100));
if (position == 0) {
progressBar.setAlpha(positionOffset);
previousButton.setAlpha(positionOffset);
} else {
progressBar.setAlpha(1.0f);
previousButton.setAlpha(1.0f);
}
}
#Override
public void onPageSelected(int position)
{
OvershootInterpolator interpolator = new OvershootInterpolator();
nextButton.setImageResource(position + 1 >= pagerAdapter.getCount()
? R.drawable.ic_check_white_24dp
: R.drawable.ic_navigate_next_white_24dp);
}
#Override
public void onPageScrollStateChanged(int state)
{
}
});
viewPager.setAdapter(pagerAdapter);
}
#Override
protected void onResume()
{
super.onResume();
slideSplashView();
setUserProfile();
checkPermissionsState();
}
#Override
public void onUserProfileUpdated()
{
super.onUserProfileUpdated();
setUserProfile();
}
#Override
public void onRequestPermissionsResult(int requestCode, #NonNull String[] permissions, #NonNull int[] grantResults)
{
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
checkPermissionsState();
}
protected void checkPermissionsState()
{
if (Build.VERSION.SDK_INT < 23)
return;
boolean permissionsOk = AppUtils.checkRunningConditions(this);
mPermissionsView.findViewById(R.id.layout_welcome_page_3_perm_ok_image)
.setVisibility(permissionsOk ? View.VISIBLE : View.GONE);
mPermissionsView.findViewById(R.id.layout_welcome_page_3_request_button)
.setVisibility(permissionsOk ? View.GONE : View.VISIBLE);
}
protected void setUserProfile()
{
if (mProfileView != null) {
NetworkDevice localDevice = AppUtils.getLocalDevice(getApplicationContext());
ImageView imageView = mProfileView.findViewById(R.id.layout_profile_picture_image_default);
ImageView editImageView = mProfileView.findViewById(R.id.layout_profile_picture_image_preferred);
TextView deviceNameText = mProfileView.findViewById(R.id.header_default_device_name_text);
TextView versionText = mProfileView.findViewById(R.id.header_default_device_version_text);
deviceNameText.setText(localDevice.nickname);
versionText.setText(localDevice.versionName);
loadProfilePictureInto(localDevice.nickname, imageView);
editImageView.setOnClickListener(new View.OnClickListener()
{
#Override
public void onClick(View v)
{
startProfileEditor();
}
});
TransitionManager.beginDelayedTransition(mProfileView);
}
}
protected void slideSplashView()
{
mSplashView.findViewById(R.id.layout_welcome_page_1_splash_image)
.setAnimation(AnimationUtils.loadAnimation(this, R.anim.enter_from_bottom_centered));
mSplashView.findViewById(R.id.layout_welcome_page_1_details)
.setAnimation(AnimationUtils.loadAnimation(this, R.anim.enter_from_bottom));
}
}

Newly receive message is not retrieving from my own Default SMS App Inbox

I am working on a project in which I have made app to default sms app and getting new message body and notification through Broadcast Receiver. It is showing toast that new message has been received and also read new message body.
But problems are
Problem 1:
The newly received sms is not retrieving from my default sms app inbox and not showing in my listview.
Problem 2:
I am not able to get each and every message from each conversation
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Log.e(TAG, "Intent recieved: " + intent.getAction());
if (intent.getAction() == SMS_RECEIVED) {
SmsMessage msg = null;
Bundle bundle = intent.getExtras();
if (bundle != null) {
Object[] pdus = (Object[])bundle.get("pdus");
final SmsMessage[] messages = new SmsMessage[pdus.length];
for (int i = 0; i < pdus.length; i++) {
messages[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
}
if (messages.length > -1) {
Log.e(TAG, "Message recieved: " + messages[0].getMessageBody());
MyNotificationManager.getInstance(context).displayNotification(messages[0].getOriginatingAddress(), messages[0].getMessageBody());
}
}
}
}
Manifest File
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WRITE_SMS"/>
<uses-sdk android:name="org.apache.http.legacy" android:required="false"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:name="com.ughareja.whocaller.utils.App"
android:networkSecurityConfig="#xml/network_security_config"
android:largeHeap="true">
<activity android:name="com.ughareja.whocaller.activities.SplashActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="#string/default_notification_channel_id" />
<receiver android:name=".smsReciever.SmsListener"
android:permission="android.permission.BROADCAST_SMS">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
<intent-filter>
<action android:name="android.provider.Telephony.SMS_DELIVER" />
</intent-filter>
</receiver>
<!-- BroadcastReceiver that listens for incoming MMS messages -->
<receiver android:name=".smsReciever.MmsReciever"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
<!-- Activity that allows the user to send new SMS/MMS messages -->
<activity android:name=".smsReciever.ComposeSmsActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</activity>
<!-- Service that delivers messages from the phone "quick response" -->
<service android:name=".smsReciever.HeadlessSmsSendService"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</service>
</application>
Can you tell me How to save receive message ?
To receive, I suggest changing your manifest:
<receiver android:name=".smsReciever.SmsListener"
android:enabled="true"
android:exported="true">
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
</receiver>
<receiver android:name=".smsReciever.MmsReciever"
android:enabled="true"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
In addition, you will need to declare the following permissions:
<uses-permission android:name="android.permission.RECEIVE_MMS"/>
<uses-permission android:name="android.permission.RECEIVE_WAP_PUSH"/>
You shouldn't be doing so much work on the receiver, send it to an intentReceiver instead:
#Override
public void onReceive(Context context, Intent intent) {
Timber.i("Intent received: " + intent.getAction());
if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) {
Bundle bundle = intent.getExtras();
Intent intentServiceIntent = new Intent(context, SMSIntentService.class);
intentServiceIntent.putExtras(bundle);
context.startService(intentServiceIntent);
//send broadcast to networkAvailableReceiver
Intent intentNetworkBroadcastReceiver = new Intent();
intentNetworkBroadcastReceiver.setAction("Youraction.CHECK_NETWORK_CONNECTIVITY");
context.sendBroadcast(intentNetworkBroadcastReceiver);
}
}
Here's what I use to parse out the message:
private fun parseOutMessages(intent : Intent?) {
val msgsAny : Array<Any>
var sender: String?
val msgBody: String
var bundle = Bundle()
if (intent != null) {
bundle = intent.extras as Bundle
}
try {
//parses out the message
val pdus = bundle.get("pdus") as Array<Any>
val msgs = Array<SmsMessage?>(pdus.size, {null})
for (i in msgs.indices) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val format = bundle.getString("format")
msgs[i] = SmsMessage.createFromPdu(pdus[i] as ByteArray, format)
} else {
msgs[i] = SmsMessage.createFromPdu(pdus[i] as ByteArray)
}
// Here you have the sender(phone number)
sender = msgs[i]?.originatingAddress
//is the message long enough to send?
var messageBodyLength = 0
if (msgs[i] != null) {
val message = msgs[i] as SmsMessage
messageBodyLength = message.messageBody.length
}
}
} catch (e: Exception) {
e.printStackTrace()
Timber.e(e)
}
}

Receive .vcf file from Files app in Nougat and Oreo versions to my app

I've an Android App, which works fine in Jelly Bean and Kitkat versions. The app will receive .vcf file as Intent from File Manager app using Complete Action Using option.
Now in Android Nougat and Oreo versions, Using Files app, there is an option Open with or Share will not list my App.
How to solve this? Thanks in advance.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app" >
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme.CustomOrange"
>
<activity>
...
...
</activity>
<activity
android:name=".ViewContactActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/title_activity_vcf" >
<intent-filter> <!-- Handle http https requests without mimeTypes: -->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="*" />
<data android:pathPattern="/.*\\.vcf" />
</intent-filter>
<intent-filter> <!-- Handle with mimeTypes, where the suffix is irrelevant: -->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="*" />
<data android:mimeType="text/x-vcard" />
</intent-filter>
<intent-filter> <!-- Handle intent from a file browser app: -->
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:host="*" />
<data android:mimeType="text/x-vcard" />
</intent-filter>
</activity>
</application>
</manifest>
ViewContactActivity.java
public class ViewContactActivity
extends AppCompatActivity {
private static final String TAG = ViewContactActivity.class.getSimpleName();
public static final String VIEW_CONTACT_BY_ID = "viewContactById";
private static final int MODE_VIEW_BY_ID = 0;
private static final int MODE_VIEW_BY_FILE = 1;
private int viewContactMode;
private ActionBar mActionBar;
ContactDetails contactDetails;
String mFilePath;
private GroupInfoPickerAlertDialog mGroupInfoPickerAD;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_vcf);
contactDetails = new ContactDetails(this);
Intent intent = getIntent();
Long id = intent.getLongExtra(VIEW_CONTACT_BY_ID, -1L);
Bitmap bitmap = null;
if (id != -1L) {
viewContactMode = MODE_VIEW_BY_ID;
contactDetails.collectContactDetail(id);
bitmap = BitmapFactory.decodeStream(new BufferedInputStream(contactDetails.getDisplayPhoto()));
} else {
viewContactMode = MODE_VIEW_BY_FILE;
Uri fileUri = intent.getData();
mFilePath = fileUri.getPath();
Log.d(TAG, "onCreate() - file path: " + mFilePath);
//onCreate() - file path: /path/to/file.vcf
contactDetails.readVCard2_1(fileUri);
}
setSupportActionBar((Toolbar)findViewById(R.id.toolbar));
mActionBar = getSupportActionBar();
if(mActionBar == null) {
Log.d(TAG, "onCreate() mActionBar == null");
} else {
Log.d(TAG, "onCreate() mActionBar != null");
}
mActionBar.setCustomView(null);
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
contactDetails.displayContact(bitmap);
if (viewContactMode == MODE_VIEW_BY_FILE) {
TextView textView = (TextView) findViewById(R.id.message_text_view);
textView.setText(mFilePath);// + "\n\n" + stringBuilder);
} else {
View v = (View) findViewById(R.id.message_text_view).getParent();
v.setVisibility(View.GONE);
}
}
// ....
// ....
// Other codes...
// ....
// ....
}
Your <intent-filter> elements support http, https, and file. Few "file manager" apps will use any of those on Android 7.0+, in part because the file scheme is banned.
Replace:
<intent-filter> <!-- Handle intent from a file browser app: -->
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:host="*" />
<data android:mimeType="text/x-vcard" />
</intent-filter>
with:
<intent-filter> <!-- Handle intent from a file browser app: -->
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.INSERT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:mimeType="text/x-vcard" />
</intent-filter>
Then, make sure that readVCard2_1() handles file and content Uri schemes, such as by calling openInputStream() on a ContentResolver to access the stream.

SecurityException Permission Denial: telephony.SmsProvider uri content://sms/inbox

my phone is android 5.0 API 22.
I just learn build app Android
I create app fake SMS but crash :(
java.lang.SecurityException: Permission Denial: writing com.android.providers.telephony.SmsProvider uri content://sms/outbox from pid=23774, uid=10308 requires android.permission.WRITE_SMS, or grantUriPermission()
My code:
MainActivity
I want test send sms default from phone number 0901123456 and message "test sent" to my phone.
public class MainActivity extends AppCompatActivity implements View.OnClickListener{
public static final String TAG = MainActivity.class.getName();
public static final int PERMISSION_RESULT_CODE = 123;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setupView();
setDefaultApp();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission(Manifest.permission.READ_SMS) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[]{
Manifest.permission.BROADCAST_SMS,
Manifest.permission.READ_SMS,
Manifest.permission.SEND_SMS,
Manifest.permission.RECEIVE_SMS}, PERMISSION_RESULT_CODE);
}
}
}
private void setupView(){
findViewById(R.id.button_draft).setOnClickListener(this);
findViewById(R.id.button_inbox).setOnClickListener(this);
findViewById(R.id.button_outbox).setOnClickListener(this);
findViewById(R.id.button_sent).setOnClickListener(this);
}
private void setDefaultApp(){
final String myPackageName = getPackageName();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (!Telephony.Sms.getDefaultSmsPackage(this).equals(myPackageName)) {
Intent intent =
new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT);
intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME,
myPackageName);
startActivity(intent);
}
}
}
#Override
public void onRequestPermissionsResult(int requestCode, #NonNull String[] permissions, #NonNull int[] grantResults) {
if (requestCode == PERMISSION_RESULT_CODE){
for (int i= 0; i< permissions.length; i++) {
Log.d(TAG, permissions[i] + " " + grantResults[i]);
}
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
#Override
public void onClick(View v) {
switch(v.getId()){
case R.id.button_draft:
ContentValues values1 = new ContentValues();
values1.put("address", "0901123456");
values1.put("body", "test draft");
getContentResolver().insert(Uri.parse("content://sms/draft"), values1);
break;
case R.id.button_inbox:
ContentValues values2 = new ContentValues();
values2.put("address", "0901123456");
values2.put("body", "test inbox");
getContentResolver().insert(Uri.parse("content://sms/inbox"), values2);
break;
case R.id.button_outbox:
ContentValues values3 = new ContentValues();
values3.put("address", "0901123456");
values3.put("body", "test outbox");
getContentResolver().insert(Uri.parse("content://sms/outbox"), values3);
break;
case R.id.button_sent:
ContentValues values4 = new ContentValues();
values4.put("address", "0901123456");
values4.put("body", "test sent");
getContentResolver().insert(Uri.parse("content://sms/sent"), values4);
break;
}
}
}
AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- BroadcastReceiver that listens for incoming SMS messages -->
<receiver
android:name=".SmsReceiver"
android:permission="android.permission.BROADCAST_SMS">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_DELIVER" />
</intent-filter>
</receiver>
<!-- BroadcastReceiver that listens for incoming MMS messages -->
<receiver
android:name=".MmsReceiver"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
<receiver
android:name=".FinderReceiver"
android:enabled="true"
android:permission="android.permission.RECEIVE_SMS">
<intent-filter>
<action
android:name="android.provider.Telephony.SMS_RECEIVED"
android:priority="999" />
</intent-filter>
</receiver>
<!-- Activity that allows the user to send new SMS/MMS messages -->
<activity
android:name=".ComposeSmsActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</activity>
<!-- Service that delivers messages from the phone "quick response" -->
<service
android:name=".HeadlessSmsSendService"
android:exported="true"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE">
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</service>
</application>
Who can help me? :((
Thank you so much!
You can only write to the SMS provider if your app is the user's chosen SMS client: https://android-developers.googleblog.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html

Why is my billing service not being called?

I am trying to implement the in app billing and I am using http://www.anddev.org/advanced-tutorials-f21/simple-inapp-billing-payment-t52060.html as my example. I have copied every file in the tutorial and only changed the name of the package. I changed my manifest so that it looks exactly like the one in the tutorial (mine has a few more things in there). As I was debugging I noticed that in my version the BillinService class was never called.
In the tutorial the Billing service's onCreate method is called after BillingHelper.setCompletedHandler is called
protected static void setCompletedHandler(Handler handler){
mCompletedHandler = handler;
}
However after it is called in my program it just continues.
Here is my review.class
package com.cellphone;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import com.cellphone.BillingHelper;
import com.cellphone.astralweb.R;
public class Review extends Activity implements OnClickListener {
private Context mContext;
private static final String TAG = "BillingService";
static SharedPreferences prefs;
static boolean lite;
private Button purchaseButton;
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.reviewpage);
prefs = getSharedPreferences("Settings", 0);
lite = prefs.getBoolean("isLite", true);
String iflite = "";
if (lite) {
iflite = "-lite";
}
TextView msg1 = (TextView) findViewById(R.id.tvreview);
msg1.setText(Html
.fromHtml(cleanhtml(getText("http://www.cellphonesolutions.net/upgrade-"
+ getResources().getString(R.string.Country) + iflite))));
purchaseButton = (Button) findViewById(R.id.btntowebsite);
purchaseButton.setOnClickListener(this);
mContext = this;
startService(new Intent(mContext, BillingService.class));
BillingHelper.setCompletedHandler(mTransactionHandler);
}
public Handler mTransactionHandler = new Handler() {
public void handleMessage(android.os.Message msg) {
Log.i(TAG, "Transaction complete");
Log.i(TAG, "Transaction status: "
+ BillingHelper.latestPurchase.purchaseState);
Log.i(TAG, "Item purchased is: "
+ BillingHelper.latestPurchase.productId);
if (BillingHelper.latestPurchase.isPurchased()) {
System.out.println("hi");
}
};
};
#Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btntowebsite:
if (BillingHelper.isBillingSupported()) {
BillingHelper.requestPurchase(mContext,
"android.test.purchased");
// android.test.purchased or android.test.canceled or
// android.test.refunded or com.blundell.item.passport
} else {
Log.i(TAG, "Can't purchase on this device");
purchaseButton.setEnabled(false); // XXX press button before
// service started will
// disable when it shouldnt
}
break;
default:
// nada
Log.i(TAG, "default. ID: " + v.getId());
break;
}
}
public String cleanhtml(String original) {
String finalText = original.replaceAll("<![^>]*>", "");
return finalText;
}
public String getText(String uri) {
HttpParams httpParams = new BasicHttpParams();
// 30seconds and it stops
HttpConnectionParams.setConnectionTimeout(httpParams, 30000);
HttpConnectionParams.setSoTimeout(httpParams, 30000);
DefaultHttpClient client1 = new DefaultHttpClient(httpParams);
HttpGet request = new HttpGet(uri);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
try {
String response_str = client1.execute(request, responseHandler);
return response_str;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "";
}
}
#Override
protected void onDestroy() {
BillingHelper.stopService();
super.onDestroy();
}
}
Because the BillingService is never called when I first create my review class, the BillingHelper.instantiateHelper is never called
protected static void instantiateHelper(Context context, IMarketBillingService service) {
mService = service;
mContext = context;
}
so my mService and mContext come up null when I try to press my button.
Thank you for helping me out.
EDIT here is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cellphone.astralweb" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<application android:theme="#style/CustomTheme" android:icon="#drawable/icon_paid" android:label="#string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name="com.cellphone.Splash" android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.LocationServiceNotification" android:screenOrientation="portrait"
android:label="#string/app_name" android:theme="#android:style/Theme.Dialog">
<intent-filter>
<action android:name="com.cellphone.LOCATIONSERVICENOTIFICATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.Registration" android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.REGISTRATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.CreateAccount" android:label="#string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="com.cellphone.CREATEACCOUNT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.Activate" android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.ACTIVATE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.ImTracking" android:label="#string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="com.cellphone.IMTRACKING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.SpecialAdapter" android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.SPECIALADAPTER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.AddPerson" android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.ADDPERSON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.TrackingMe" android:label="#string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="com.cellphone.TRACKINGME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.InviteFollower" android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.INVITEFOLLOWER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.Settings" android:label="#string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.TabPage" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait" android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="com.cellphone.TABPAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.Review" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.REVIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.help" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.HELP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.Maps" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.MAPS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.HelloItemizedOverlay" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.HELLOITEMIZEDOVERLAY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.History" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.HISTORY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.cellphone.MyCustomLocationOverlay" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.MYCUSTOMLOCATIONOVERLAY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service android:name="com.cellphone.UpdateLocation" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.cellphone.UPDATELOCATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service android:name=".BillingService" />
<receiver android:name=".BillingReceiver">
<intent-filter>
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>
</receiver>
</application>
</manifest>
The problem was in my manifest, I named my service wrong
it should be
<service android:name="com.cellphone.BillingService" />
not <service android:name=".BillingService" />

Categories

Resources