android-intent

How to show up interstrial ads, while opening two different URL in webview with Intent?

女生的网名这么多〃 提交于 2020-01-05 07:50:14
问题 So i am using intent to load two URL's from single web view with the help of switch case. Now i want to implement, intrestrial ads to show when anyone clicks on button before webview is loaded. Below is my code. """Home Activity"" public class home extends AppCompatActivity { AdView mAdview3; private InterstitialAd interstitialAd; public RatingBar ratingbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home

Sharing file in Oreo not working

江枫思渺然 提交于 2020-01-05 07:05:14
问题 I'm trying to share an audio file in Oreo. If the file is in internal storage of the device, it runs fine but if the file is present on the external storage it crashes giving this exception - android.os.FileUriExposedException. How to solve this problem: public void shareSong(SongInfoModel songInfoModel){ Uri uri = Uri.parse(""); File f = new File(songInfoModel.getData()); if(Build.VERSION.SDK_INT<=Build.VERSION_CODES.N_MR1) { uri = Uri.parse("file://" + f.getAbsolutePath()); }else { uri =

Android: Set Text View's text from another activity Not working

回眸只為那壹抹淺笑 提交于 2020-01-05 04:41:11
问题 I have 2 activities and 2 classes. In my Main class, when i click submit button it will start another activity. here is the code. public void onClick(View v) { startActivity(new Intent(MainActivity.this, NewActivity.class)); newActivity.setViewValues(fNameET.getText().toString(), lNameET.getText().toString(), mInitialET.getText().toString(), "Female", "birthday", addressET.getText().toString(), cNumberET.getText().toString()); } The newActivity is an object of the other activity and the

RecyclerView OnItemclick not working properly

落爺英雄遲暮 提交于 2020-01-05 04:07:06
问题 I have a recycler view and I am implementing OnClicklistener inside it. Basically , I have an adapter class called actressadapter and a viewholder class MyViewHolder.I am implementing OnClickListener inside viewholder class to initiate another activity via intent method. My basic data is inside a class called actress which has three variables name,country(both String) and an Id(UUID). I am providing this data that is of actresses to my adapter.Next activity is just displaying the name of

How to make a phone call programatically without Intent

与世无争的帅哥 提交于 2020-01-05 02:51:08
问题 I'm new on android and i want make phone call without use the intent . I know that this code: Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse("tel:" + bundle.getString("mobilePhone"))); context.startActivity(intent); Can i make call in android programmatically without use " Intent "? Do you have any answer? Thanks 回答1: Can i make call in android programmatically without use "Intent"? Not from an ordinary Android SDK app. A custom ROM mod certainly could. 回答2: You can

send broadcast intent to only one application without using explicit intent

允我心安 提交于 2020-01-04 18:16:52
问题 I have a problem. I'm doing a external android service where applications can register to it to receive information. The information come back to the apps from the service via broadcast, and receive it with a broadcastReceiver . The problem is if I do sendBroadcast , any app can listen the information that is for others, I can use the category on the intent filter, but both apps can have it the same category, or a malicous app can do this one on pourpose. A solution is explicit intents, but

Android Intent through jar

一世执手 提交于 2020-01-04 16:58:21
问题 I have development one Android Application which has one UI design (like user name,password) i converted my Application into jar(it means i convert my application as library project) after i got the Jar.i used in another application i follow this method 1. I added my jar into Reference library path 2. I include the jar in library path 3. I added my jar in Android manifest file like : <activity android:name=".MainActivity"></activity> (which in jar file) 4. In my src of my second Application i

Starting Activity when video is finished playing

六眼飞鱼酱① 提交于 2020-01-04 11:11:13
问题 In my Android app, I am trying to simply go back to my main Activity once a video that I am playing ends. I have tried many workarounds, but I can't find a way to call StartActivity from the video onCompletionListener - I am getting the "cannot make a static reference to the non-static method startActivity(Intent) from the type Activity" error. I tried getting a context from the Activity that preceded the videoView, and passing that to the intent/startActivity. That allowed the app to compile

Intent Image Capture data==null

99封情书 提交于 2020-01-04 11:03:23
问题 I have this code, and it works perfectly in an Ericsson XPERIA, but when I test the app in a SAMSUNG ACE, appears the error : data=null String file=Environment.getExternalStorageDirectory().getAbsolutePath()+ "/picture.jpg"; Intent i=new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Uri output = Uri.fromFile(new File(archivo)); i.putExtra(MediaStore.EXTRA_OUTPUT, output); startActivityForResult(i,CAMERA_REQUEST); OnActivity Result if (requestCode==CAMERA_REQUEST && resultCode=

android - working with broadcastReceiver on android ICS (version 4)

允我心安 提交于 2020-01-04 09:01:46
问题 i'm having a problem on android ICS (version 4) and broadcastReceiver . please help: i'm trying to listen to a simple intent of network connectivity change . i've tried the next tutorial (with the broadcastReceiver defined in the manifest alone - the first part of the website ) : http://www.xinotes.org/notes/note/1526/ on ICS , it doesn't capture any intent , and on any other version it works just fine . can anyone please tell me what's wrong? do i need to add a new intent filter other than