是否可以在Android中禁用Action Bar中的按钮?我环顾四周,找不到任何代码片段,我当时认为应该有一些简单的方法.
我想知道Hijri日历是否有任何jQuery DatePicker插件?
我使用以下代码来获取当前位置即(纬度和经度),但我没有获得当前位置(纬度和经度).
谁知道为什么?
package com.ram.currentlocation;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;
public class Location_Gps extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/* Use the LocationManager class to obtain GPS locations */
LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
}
/* Class My Location Listener */
public class MyLocationListener implements LocationListener
{
@Override
public …Run Code Online (Sandbox Code Playgroud) android geolocation latitude-longitude google-latitude geocode
我目前正在从android站点了解导航抽屉,我正在使用他们的示例http://developer.android.com/training/implementing-navigation/nav-drawer.html
我想要的是在MainActivity其中添加一个能够打开的按钮NavigationDrawer.我需要以编程方式,而不是XML.我怎样才能做到这一点?
我使用了一个表达式来验证一个正数,如下所示:
^\d*\.{0,1}\d+$
Run Code Online (Sandbox Code Playgroud)
当我给它输入-23时,它会将输入标记为负数,但当我输入+23时,它会将其标记为无效数字!
问题是什么?
任何人都可以给出一个解决方案,+ +它将返回(正面)?
我想知道ListActivity当我更改/添加数据时如何刷新.
我首先想到的是,ListAdapter当列表发生更改时会知道,但是当我向列表添加元素时,没有更新ListActivity,只有当我关闭ListActivity并再次重新打开它时,我才会看到更改发生.
所以我搜索了任何方法,例如:update(), refesh()或类似的东西,但没有.似乎我没有得到这个概念,有人可以帮助我吗?
我使用AngularJS和UI的路由器和我app.js.我有以下几行:
$urlRouterProvider.otherwise('/');
Run Code Online (Sandbox Code Playgroud)
但是,我不希望它将用户发送到URL,而是 发送到以下状态:
.state('404',
{
views: {
'body': {
templateUrl: 'partials/404.html',
}
}
});
Run Code Online (Sandbox Code Playgroud)
通常我会这样做:
$state.go('404');
Run Code Online (Sandbox Code Playgroud)
如何为其他方法执行此操作?
注意:我的404状态没有URL,因此基本上它保留了用户输入或访问的URL,只是更改了模板.
当我尝试在localhost服务器上运行我的node.js应用程序时,它不会运行并要求进行必要的升级.我试图运行代码,但我收到以下错误:
服务器代码
var WebSocketServer = require('ws').Server,
ws = new WebSocketServer({port: 80}),
CLIENTS=[];
**new connection etablished**
ws.on('connection', function(conn) {
CLIENTS.push(conn);
conn.on('message', function(message) {
console.log('received: %s', message);
sendAll(message);
});
console.log("new connection");
conn.send("NOUVEAU CLIENT CONNECTE");
**if you close connection**
conn.on('close', function() {
console.log("connection closed");
CLIENTS.splice(CLIENTS.indexOf(conn), 1);
});
});
**send messeages vers all clients**
function sendAll (message) {
for (var i=0; i<CLIENTS.length; i++) {
var j=i+1;
CLIENTS[i].send("Message pour le client "+j+": "+message);
}
}
Run Code Online (Sandbox Code Playgroud)
客户代码
<p>
Result :<output name="" type="text" id="result" value"readonly"></output>
</p>
<input …Run Code Online (Sandbox Code Playgroud) 我需要一个工具来比较一个网站的设计,我不想只比较HTML代码,而是输出设计.
这甚至可能吗?还有这种开源项目吗?
我搜索了谷歌,但到目前为止我只得到一个候选人,这是一个HTML匹配.
如何通过事件广播对象?
目前我正在尝试:
app.run ($rootScope) ->
message = {type: 'channel', action: 'create', data: { name: "ssss", id: 0}}
$rootScope.$broadcast('message', message)
angular.module('WebChat').controller 'ChannelController', ($scope) ->
$scope.$on 'message', (message) ->
console.log message
console.log 'hi'
Run Code Online (Sandbox Code Playgroud)
但我没有输出
编辑 我得到了它的工作.似乎回调函数的第一个参数是范围.我不得不将控制器更改为:
angular.module('WebChat').controller 'ChannelController', ($scope) ->
$scope.$on 'message', (scope, message) ->
console.log message
console.log 'hi'
Run Code Online (Sandbox Code Playgroud) android ×4
javascript ×3
angularjs ×2
jquery ×2
button ×1
calendar ×1
compare ×1
drawer ×1
geocode ×1
geolocation ×1
hijri ×1
html ×1
jquery-ui ×1
listactivity ×1
node.js ×1
real-time ×1
validation ×1
websocket ×1