Eclipse Xml Incorrect Line Endings
Incorrect line ending: found carriage return (\r) without corresponding newline (
)
Move mouse cursor on error text and press Ctrl+1
Select Fix line endings and press Enter
See image below:
)
Move mouse cursor on error text and press Ctrl+1
Select Fix line endings and press Enter
See image below:
396LW NO topic_id
AD
Další témata ....(Topics)
Window>Preference>Java>Editor>Typing and check the "Escape text when pasting into a string literal".
Try this solution:
String DATA = "Html text....bla bla bla. Hellou world! čšřžěéá";
String HEADERHTML =
"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">"
+"<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8">"
+"</head> <body>";
String FOOTERHTML = "</body></html>";
WebView mWebView.loadData(HEADERHTML+DATA+FOOTERHTML,"text/html; charset=UTF-8",null);
Jak povolit komentáře je přihlášeným uživatelům.
Spam v komentářích je nepříjemný a zatěžuje server. Jednou z metod, jak jej omezit je povolit přidávat komentáře jen registrovaným členům. Toho ve Wordpress dosáhneme v administraci z menu Settings - Discussion kde zaškrtneme políčko Users must be registered and logged in to comment a nastaveni uložíme.
Spam v komentářích je nepříjemný a zatěžuje server. Jednou z metod, jak jej omezit je povolit přidávat komentáře jen registrovaným členům. Toho ve Wordpress dosáhneme v administraci z menu Settings - Discussion kde zaškrtneme políčko Users must be registered and logged in to comment a nastaveni uložíme.
First: AdView is in XML file
Second: Using AdView in Fragment with LinearLayout
Resolve error in ADT Graphical layout editor:
The following classes could not be instantiated:
- com.google.android.gms.ads.AdView
More about:
https://developers.google.com/mobile-ads-sdk/docs/admob/android/play-migration?hl=it
<com.google.android.gms.ads.AdView
xmlns:ads="//schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="MY_AD_UNIT_ID"
ads:adSize="BANNER"/>
// onResume
AdView adView = (AdView)this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("TEST_DEVICE_ID")
.build();
adView.loadAd(adRequest);
Second: Using AdView in Fragment with LinearLayout
Resolve error in ADT Graphical layout editor:
The following classes could not be instantiated:
- com.google.android.gms.ads.AdView
// layout in xml file
<LinearLayout
android:id="@+id/layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
// java class with fragment in Fragment class or in Activity class
private static AdView adView;
@Override
public void onResume(){
super.onResume();
try {
// in xml is empty layout
adView = new AdView(getActivity());
adView.setAdUnitId("ca-app-pub-626/638103xxxxxxx");
adView.setAdSize(AdSize.BANNER);
LinearLayout layout = (LinearLayout)getView() .findViewById(R.id.layout);
layout.addView(adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
More about:
https://developers.google.com/mobile-ads-sdk/docs/admob/android/play-migration?hl=it
package cz.okhelp.surfview;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnTouchListener;
public class MainActivity extends Activity implements OnTouchListener {
OurView v;
Bitmap ball, blob;
float x, y;
Sprite sprite;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_our_view);
v = new OurView(this);
v.setOnTouchListener(this);
ball = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
x = y = 0;
setContentView(v);
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
v.pause();
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
v.resume();
}
public class OurView extends SurfaceView implements Runnable {
Thread t = null;
SurfaceHolder holder;
boolean isItOK = false;
public OurView(Context context) {
super(context);
// TODO Auto-generated constructor stub
holder = getHolder();
}
public void run() {
// TODO Auto-generated method stub
while (isItOK == true) {
// perform canvas drawing
if (!holder.getSurface().isValid()) {
continue;
}
// sprite = new Sprite(OurView.this,blob);
Canvas c = holder.lockCanvas();
c.drawARGB(255, 100, 100, 10);
c.drawBitmap(ball, x, y, null);
// onDraw(c);
holder.unlockCanvasAndPost(c);
}
}
protected void onDraw(Canvas canvas) {
// sprite.onDraw(canvas);
}
public void pause() {
isItOK = false;
while (true) {
try {
t.join();
} catch (InterruptedException e) {
// TODO: handle exception
e.printStackTrace();
}
break;
}// end while
}
public void resume() {
isItOK = true;
t = new Thread(this);
t.start();
}
}
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
x = event.getX();
y = event.getY();
break;
case MotionEvent.ACTION_UP:
x = event.getX();
y = event.getY();
break;
case MotionEvent.ACTION_MOVE:
x = event.getX();
y = event.getY();
break;
}// end switch
return true;
}
}
Editace: 2014-02-15 20:28:16
Počet článků v kategorii: 396
Url:eclipse-xml-incorrect-line-endings