我已经创建了一个意图使用
browserIntent =new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));
Run Code Online (Sandbox Code Playgroud)
我怎么关闭它?是吗
browserIntent.close
Run Code Online (Sandbox Code Playgroud)
或某事......也许吧
browserIntent.finish(); ?
Run Code Online (Sandbox Code Playgroud) for (int i=0; i<pages; i++) {
ImageView img=new ImageView(this);
...
img.setOnClickListener(new OnClickListener() {
@Override public void onClick(View v) {
showpage(i);
}
}
});
FLall.addView(img);
}
Run Code Online (Sandbox Code Playgroud)
我怎么能在java中这样做?我总是"不能在不同方法中定义的内部类中引用非最终变量i"
$a = array(2, 4, 6, 8);
echo "sum(a) = " . array_sum($a) . "\n"; //==20
Run Code Online (Sandbox Code Playgroud)
我怎么能在java中做到这一点?
Body b;
while ((b=box2d.physics.PhysicssWorld.world.getBodyList().getNext())!=null) {
Shape shape;
while ((shape=b.getShapeList().getNext())!=null) {
Log.e("name",""+b.getUserData().toString()+" "+shape+" ");
opengl.saveMatrix();
Meshes.select(b.getUserData().toString())
.translate((b.getPosition().x)*RATIO, (b.getPosition().y)*RATIO)
.rotate((int) ((int) b.getAngle()* (180 / Math.PI)), 0, 0, 1)
.draw(shape, 1,1,1);
opengl.loadMatrix();
}
}
Run Code Online (Sandbox Code Playgroud)
我想得到我的身体的形状,但我什么都得不到,只有空...为什么?
永远不要运行这一行:Log.e("name",""+ b.getUserData().toString()+""+ shape +"");
所以shape = b.getShapeList().getNext())总是为null ...
什么比ArrayList<String>Java 更快?我有一个未定义长度的列表.(有时4件,有时100件).
什么是从任何列表中添加和获取它的最快方式?arrayList.add(string)并且get()非常慢.
有更好的方法吗?(string s[]然后copyArray是最慢的?)
Pattern.compile("((http\\://|https\\://|ftp\\://|sftp\\://)|(www.))+((\\S+):(\\S+)@)?+(([a-zA-Z0-9\\.-]+\\.[a-zA-Z]{2,4})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(/[a-zA-Z0-9%:/-_\\?\\.'~]*)?");
Run Code Online (Sandbox Code Playgroud)
我有这种模式,我想测试我的字符串中是否有链接.我想将这些文本链接到一个TextView.
链接包含&字符时,代码不起作用.
完整代码:
Pattern httpMatcher = Pattern.compile("((http\\://|https\\://|ftp\\://|sftp\\://)|(www.))+((\\S+):(\\S+)@)?+(([a-zA-Z0-9\\.-]+\\.[a-zA-Z]{2,4})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(/[a-zA-Z0-9%:/-_\\?\\.'~]*)?");
String httpViewURL = "myhttp://";
Linkify.addLinks(label, httpMatcher, httpViewURL);
Run Code Online (Sandbox Code Playgroud) 我的代码是:
public static Object mylang;
public static class lang_eng {
public static final String x="Refreshing...";
}
public static class lang_de {
public static final String x="Refreshing...";
}
Run Code Online (Sandbox Code Playgroud)
...
if (LANG.equals("1")) {
mylang=(lang_eng)new Object();
} else {
mylang=(lang_de)new Object();
}
Run Code Online (Sandbox Code Playgroud)
但是当我参考时mylang.x,我得到:"x无法解决或不是一个字段"
这是什么解决方案?
我在很多应用程序中看到了..当你点击一个菜单,而不是其他菜单出现,你可以通过电子邮件,推特,蓝牙,脸书等分享你的应用程序.
我怎样才能做到这一点?
我怎样才能做到这一点?
我试过了
return so.split("\\x00");
Run Code Online (Sandbox Code Playgroud)
要么
return so.split(String.valueOf(0x00));
Run Code Online (Sandbox Code Playgroud)
没有用(我的字符串也是)
谢谢,莱斯利
如何使用XDocument解析此图像?
<enclosure length="1234" type="image/jpeg" url="http://asd.com/media/picture/1/80/71/3223wee.jpg" />
Run Code Online (Sandbox Code Playgroud)
我的rss看起来像这样
<item>
<title>aaa</title>
<desc>aaa</desc>
<enclosure length="3234" type="image/jpeg" url="http://asd.com/media/picture/1/80/71/1223wee.jpg" />
</item>
<item>
<title>aaa</title>
<desc>aaa</desc>
<enclosure length="1234" type="image/jpeg" url="http://asd.com/media/picture/1/80/71/3223wee.jpg" />
</item>
Run Code Online (Sandbox Code Playgroud)
编辑:
工作正确的代码:
XDocument xdoc = XDocument.Parse(e.Result);
var data = from query in xdoc.Descendants("item")
select new Cikk
{
Title = (query.Element("title") == null) ? "" : (string)query.Element("title").Value.ToString().Replace("<![CDATA[", "").Replace("]]>", ""),
Description = (query.Element("description").Value.Equals("")) ? "" : (string)query.Element("description").Value.ToString().Replace("<![CDATA[", "").Replace("]]>", "").Substring(0, 20) + "...",
Source = (query.Element("enclosure") == null) ? "" : (string)query.Element("enclosure").Attribute("url").Value
};
Run Code Online (Sandbox Code Playgroud) sLine = sLine.replaceAll("&&", "&");
sLine = sLine.replaceAll(((char)245)+"", "?");
sLine = sLine.replaceAll(((char)213)+"", "?");
sLine = sLine.replaceAll(((char)361)+"", "?");
sLine = sLine.replaceAll(((char)251)+"", "?");
Run Code Online (Sandbox Code Playgroud)
有没有办法只到这一行?这在大字符串上非常慢.
尝试使用GSON发布类似的内容并进行改造:
{user: {"email":"asdfghj@wedssd.jk","name":"fjnhfioewhifhjierj","password":"password""} }
Run Code Online (Sandbox Code Playgroud)
代替
{"email":"asdfghj@wedssd.jk","name":"fjnhfioewhifhjierj","password":"password"}
Run Code Online (Sandbox Code Playgroud)
在2.0中删除了TypedInput和TypedByteArray,这怎么可能?