adview

How to use addView to add view to layout?

妖精的绣舞 提交于 2020-04-08 19:03:19
问题 I have read probably all posts and documentation but I still can't solve this issue. I want to use addView() method to add view to the existing (running) layout but for some reason I cant. I know that this should be easy and basic but still I cant do it. So, please help me. Here is a code: LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout); TextView text = new TextView(this); text.setText("test"); layout.addView(text); That's a code, and the result is that I have displayed only

How to use addView to add view to layout?

ぃ、小莉子 提交于 2020-04-08 19:01:38
问题 I have read probably all posts and documentation but I still can't solve this issue. I want to use addView() method to add view to the existing (running) layout but for some reason I cant. I know that this should be easy and basic but still I cant do it. So, please help me. Here is a code: LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout); TextView text = new TextView(this); text.setText("test"); layout.addView(text); That's a code, and the result is that I have displayed only

How to hide/disable admob adview?

南笙酒味 提交于 2020-01-12 05:29:07
问题 I hide admob adview by view.gone: //adView.setClickable(false); //adView.clearFocus(); //adView.setEnabled(false); //adView.setFilterTouchesWhenObscured(true); //adView.setFocusable(false); //adView.setFocusableInTouchMode(false); adView.setVisibility(View.GONE); adView.startAnimation( animation ); This hides the ad, but the adview itself is still touchable, so if I touch the adview's space, it still opens the browser and redirects me to the ad, although the ad itself is not visible. How to

Android AdSense. Can't see an advertisement in an application

坚强是说给别人听的谎言 提交于 2020-01-05 07:34:08
问题 I have a problem with AdSence. I have tried to resolve it the last couple of days but without any good results. I used developers guide but it still empty on the place of banner. What am I doing in an application. First of all I have added a TableRow object and added AdView to it: banner = new TableRow(engine); banner.setGravity(Gravity.TOP & Gravity.RIGHT); adView = new AdView(engine, AdSize.BANNER, "a14def8xxxxxxxx"); banner.addView(adView); AdRequest request = new AdRequest(); adView

Admob mediation - publisher ID vs Mediation ID

会有一股神秘感。 提交于 2020-01-01 14:22:48
问题 I want to know what is the right paradigm for Admob mediation. so far, I've got a normal AdView banner. this is how think it should work: onFailedToReceiveAd - catch this event which mean admob cannot supply ads. create new AdView banner with the mediation id and make it VISIBLE so, is this the best practice? create two banners. one with the "regular" publisher ID and the other one, with the mediation ID 回答1: The correct approach is: Create a banner with a Mediation ID. When configuring that

Android Adview getting error

六月ゝ 毕业季﹏ 提交于 2019-12-25 19:45:32
问题 I get these errors when placing adview ad. error: Error parsing XML: unbound prefix <com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="match_parent" android:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitId="ca-app-pub-2852987101120590/2338373260" /> error: adView cannot be resolved or is not a field AdView adView = (AdView)this.findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder().build(); adView.loadAd(adRequest); where is

Admob banner not showing Android

强颜欢笑 提交于 2019-12-25 07:50:27
问题 My admob banner in my app is not showing. It's just a white space, I have added parts to all manifest, xml and java files. Anyone can spot any errors within my xml? Thanks for any help. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:fab="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" xmlns:ads=

Android Admob ad not shown in Activity with fragment. Why?

做~自己de王妃 提交于 2019-12-25 03:36:23
问题 I have an activity as follows. I launch it inside another activity using setContentView(R.layout.below); However, below.xml contains a pager (which is a fragment and has its own textview, webview etc.). My problem is even though the Google Ads block is shown in the graphical layout on Eclipse and NO error is thrown when I run the java code shown below; I CAN NOT see the ad. I don't understand what is happening! I've tried so many things, including changing this layout to a simple relative

How to fix view that is misplaced and only comes to right place after I scroll inside the RecyclerView

丶灬走出姿态 提交于 2019-12-24 19:39:16
问题 This is the problem: https://imgur.com/gallery/pRFhG9e?s=wa I already asked once (How to avoid admob adview being cut off) but didn't get any successful answers. I have new info that I didn't provide in the previous question. I have realized that the AdView comes back to the right place after I scroll up or down the RecyclerView, so I think the problem is related to the RecyclerView somehow pushing down the AdView. Some new solutions I have tried inside onResume and have failed: Use

AdView failed to instantiate

。_饼干妹妹 提交于 2019-12-24 14:15:19
问题 I want to include an admob banner in my application and I got this weird error. Any help is deeply appreciated. Here is the xml code <com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="bottom" ads:adUnitId="..." ads:adSize="BANNER" /> In the activity, I wrote the following code adview = (AdView)findViewById(R.id.adView); adview.setVisibility(View.VISIBLE); AdRequest re = new AdRequest(); adview.loadAd(re);