如果我有一个带有这样一个键的HashMap:
[pubDate, title, link]和这样的值(例子):
[Thu, 03 Jan 2013 21:50:02 +0100, Transferts - YBX : ''Je change de dimension'', http://www.link.fr/info/link_informations.html]
Run Code Online (Sandbox Code Playgroud)
我可以检索链接http://www.link.fr/info/link_informations.html吗?码:
for (int i = 0; i < nl.getLength(); i++) {
// creating new HashMap
map = new HashMap<String, String>();
Element e = (Element) nl.item(i);
// adding each child node to HashMap key => value
map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
map.put(KEY_LINK, parser.getValue(e, KEY_LINK));
map.put(KEY_DATE, parser.getValue(e, KEY_DATE));
//map.put(KEY_DESC, parser.getValue(e, KEY_DESC));
// adding HashList to ArrayList
menuItems.add(map);
}
Run Code Online (Sandbox Code Playgroud) 我想在我的应用程序中制作一个启动画面,因为我需要知道如何以全屏显示图像.这可以通过XML或Java代码制作吗?如何?现在我刚刚做了这个:
public class SplashScreen extends Activity {
private static final int STOPSPLASH = 0;
private static final long SPLASHTIME = 5000;
private Handler splashHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case STOPSPLASH:
//remove SplashScreen from view
Intent intent = new Intent(SplashScreen.this, jetpack.class);
startActivity(intent);
break;
}
super.handleMessage(msg);
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash_screen);
Message msg = new Message();
msg.what = STOPSPLASH;
splashHandler.sendMessageDelayed(msg, SPLASHTIME);
}
}
Run Code Online (Sandbox Code Playgroud)
这个splash_screen.xml怎么样?谢谢您的帮助.
在我的webview活动中,我可以垂直(向上和向下)滚动网页,但我不能水平滚动(从右到左或从左到右),当我也缩放网页时,仍然没有水平滚动.
有没有可能在webview中添加这个?非常感谢你.
getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setSupportZoom(true);
mWebView.setVerticalScrollBarEnabled(true);
mWebView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
{
//Make the bar disappear after URL is loaded, and changes string to Loading...
MyActivity.setTitle("Loading...");
MyActivity.setProgress(progress * 100); //Make the bar disappear after URL is loaded
// Return the app name after finish loading
if(progress == 100)
MyActivity.setTitle(R.string.app_name);
}
});
mWebView.setWebViewClient(new Manipulation());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(myURL);
Run Code Online (Sandbox Code Playgroud)
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/> …Run Code Online (Sandbox Code Playgroud) 我想在UILocalNotification每个星期天晚上8点触发,但是,我每天晚上8点都有一个火灾日期.
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDate *now = [NSDate date];
NSDateComponents *componentsForFireDate = [calendar components:(NSYearCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit| NSSecondCalendarUnit | NSWeekdayCalendarUnit) fromDate: now];
[componentsForFireDate setWeekday: 1] ; //for fixing Sunday
[componentsForFireDate setHour: 20] ; //for fixing 8PM hour
[componentsForFireDate setMinute:0] ;
[componentsForFireDate setSecond:0] ;
NSDate *fireDateOfNotification = [calendar dateFromComponents: componentsForFireDate];
UILocalNotification *notification = [[UILocalNotification alloc] init] ;
notification.fireDate = fireDateOfNotification ;
notification.timeZone = [NSTimeZone localTimeZone] ;
notification.alertBody = [NSString stringWithFormat: @"New updates!"] ;
notification.userInfo= [NSDictionary …Run Code Online (Sandbox Code Playgroud) 我想为我的应用程序设置一个图标,并且不知道放入三个文件夹hdpi/ldpi/mdpi的确切分辨率.此外,我想将图标设置为我的菜单选项,不知道应用什么分辨率.
谢谢您的帮助.
我想从我的应用程序访问youtube以打开一个频道.我搜索了一个解决方案但我刚刚找到了如何打开/流式传输视频:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:VIDEO_ID"));
startActivity(i);
Run Code Online (Sandbox Code Playgroud)
但直接打开一个频道怎么样?
非常感谢你.
我正在开发SIP应用程序,当我想调用某人(在服务器中配置其标识符)时,我有一个NullPointerException =>"尝试关闭管理器时出错".这是代码:
public void initiateCall() {
updateStatus(sipAddress);
try {
SipAudioCall.Listener listener = new SipAudioCall.Listener() {
@Override
public void onCallEstablished(SipAudioCall call) {
call.startAudio();
call.setSpeakerMode(true);
call.toggleMute();
updateStatus(call);
}
@Override
public void onCallEnded(SipAudioCall call) {
updateStatus("Ready.");
}
};
call = manager.makeAudioCall(me.getUriString(), sipAddress, listener, 30);
}
catch (Exception e) {
Log.i("WalkieTalkieActivity/InitiateCall", "Error when trying to close manager.", e);
if (me != null) {
try {
manager.close(me.getUriString());
} catch (Exception ee) {
Log.i("WalkieTalkieActivity/InitiateCall",
"Error when trying to close manager.", ee);
ee.printStackTrace();
}
}
if (call …Run Code Online (Sandbox Code Playgroud) 我已经开发了一个歌词查找器应用程序,花了一个多月的时间在数据库中添加和组织它们,昨天,由于使用受保护的第三方材料,Apple审核小组拒绝了我的应用程序.
使用由第三方拥有版权的材料需要有书面证据证明您有权在您的申请中使用此类内容.
在这种情况下我应该怎么做,我应该联系每位艺术家,告诉他我是否可以在我的应用程序中添加他的歌词?!?!他们是什么意思documented evidence?我觉得他们要求一个不可行的东西.我不能接受在一个多月的时间里所做的一切都消失了!你以前遇到过这种拒绝吗?还有可行吗?以下是该应用的2个屏幕截图(Apple评论团队发送/选择):


那个怎么样:https: //itunes.apple.com/us/app/lyrics-lite-lyricfind/id310626563?mt = 8 那一个:https: //itunes.apple.com/us/app/lyrics+/id376969803?MT = 8
不是误判?!
我有一个包含三个异步方法的for循环,我希望在这3个异步方法完成后进行一些处理.
-(void)getAllUsersInformations{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
for(User *user in users){
[self getUserInfo:user];
}
//Here, I want to reload the table view for example, after finishing the for loop (executing the whole three methods).
});
}
-(void)getUserInfo:(User*)user{
[self getInformations:user];
[self getExperiences:user];
[self getEducation:user];
}
Run Code Online (Sandbox Code Playgroud)
你有任何技术可以得到这个结果吗?非常感谢你.
我有一个按钮,当我点击它时,我想调用Youtube应用程序并搜索预定义的字符串(搜索字符串是常量,我的意思是Youtube应用程序将自动显示结果).我知道,为了搜索频道,我们放了
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.youtube.com/user/channel"))
Run Code Online (Sandbox Code Playgroud)
但是搜索特定视频(常量字符串)呢?谢谢您的帮助.