嘿,我知道以前曾经问过,但没有一个解决方案似乎有所帮助.我在我的应用程序中首次使用Facebook SDK.
我尝试过的:
我曾尝试过在互联网上发现的大部分内容,但没有得到任何关于此的内容.
这是我的MainActivity.java:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FacebookSdk.sdkInitialize(getApplicationContext());
}
}
Run Code Online (Sandbox Code Playgroud)
这是My Activitymain.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:facebook="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.facebook.login.widget.LoginButton
android:id="@+id/connectWithFbButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_horizontal"
android:text=" connect_with_facebook" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
看我的Logcat:
05-13 16:30:39.332: E/AndroidRuntime(10264): Caused by: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
Run Code Online (Sandbox Code Playgroud) 我将导航抽屉图标更改为自定义图标时遇到问题.我目前不得不实现标准的抽屉图标,顶部有3条水平线,但现在我想用我的自定义抽屉图标替换它.
这就是我mDrawerToggle
现在的样子:
mDrawerToggle=new ActionBarDrawerToggle(this,
mDrawerLayout,
R.drawable.app_icon,
R.string.drawer_open) {
// My code
};
Run Code Online (Sandbox Code Playgroud) android android-actionbar android-drawable android-navigation android-actionbaractivity
我正在开发一个使用谷歌和Facebook集成的应用程序...我想修复那些按钮的高度和宽度...我想设置按钮文字手动...
我到目前为止尝试过
<com.facebook.login.widget.LoginButton
xmlns:fb="http://schemas.android.com/apk/res-auto"
android:id="@+id/connectWithFbButton"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="@string/fbloginText"
android:layout_marginTop="30dp"
/>
<com.google.android.gms.common.SignInButton
android:id="@+id/signin"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="@string/googleloginText"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"/>
Run Code Online (Sandbox Code Playgroud)
虽然我已经注意到了这样的事情
fb:login_text="Login"
fb:logout_text="Logout"
or
facebook:login_text="Login"
Run Code Online (Sandbox Code Playgroud)
但我收到错误:: =>在'com.test.b2c'包中找不到属性'login_text'的资源标识符
或通过编码
loginButton = (LoginButton) findViewById(R.id.connectWithFbButton);
loginButton.setText("Login");
Run Code Online (Sandbox Code Playgroud)
现在我的布局看起来像这样
我也想设置这个按钮的高度和宽度.. ...帮助我的朋友..... thx提前
UPDATE
我在设置宽度方面没有直接问题我真正关心的是图片中显示的不一致的HEIGHT.我需要找到更好的方法来使这些按钮高度相同,并将Text设置为那些Button.
android facebook android-linearlayout google-plus android-facebook
我是Android新手.
我想知道如何在我的应用程序中集成ATOM支付网关移动结账页面?
我想要它,以便用户填写他的信用卡详细信息并在线支付.
如果我使用其他支付网关,如Paytm或Payu,他们提供SDK,但Atom不提供
任何帮助,将不胜感激
我有一个像这个图像的导航抽屉.我想添加一个节分隔符.这看起来很简单,但我在网上找不到对我的情况有用的任何内容.
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Express">
<menu>
<group
android:id="@+id/me"
android:checkableBehavior="single">
<item
android:id="@+id/nav_balance_transfer"
android:icon="@mipmap/icon_wallet_transfer"
android:title="Balance Transfer" />
<item
android:id="@+id/nav_load_money"
android:icon="@mipmap/icon_load_money"
android:title="Load Money" />
<item
android:id="@+id/nav_report"
android:icon="@mipmap/icon_history"
android:title="Report" />
</group>
</menu>
</item>
<item android:title="My Information">
<menu>
<group
android:id="@+id/menu_nav_temp_gid"
android:checkableBehavior="none">
<item
android:id="@+id/nav_profile"
android:icon="@mipmap/icon_profile"
android:title="My Account" />
<item
android:id="@+id/nav_changePassword"
android:icon="@mipmap/icon_change"
android:title="Change Password" />
<item
android:id="@+id/nav_ViewUser"
android:icon="@mipmap/ic_view_user"
android:title="View User" />
<item
android:id="@+id/nav_addUser"
android:icon="@mipmap/icon_adduser"
android:title="Add User" />
<item
android:id="@+id/nav_addScheme"
android:icon="@mipmap/icon_add_scheme"
android:title="Add Scheme" />
<item
android:id="@+id/nav_logout"
android:icon="@mipmap/icon_logout"
android:title="Log Out" />
</group>
</menu>
</item>
Run Code Online (Sandbox Code Playgroud)
我已经完成了这个代码,如果我把express和我的信息放在一个单独的组中,而不是填充
建议我如何实现这个..
我在图像表字段中有一个图像,我想在我的应用程序我的PHP页面使用该图像
$user = array();
$user["image"] = base64_encode($result["image"]);
// success
$response["success"] = 1;
// user node
$response["image_table"] = array();
array_push($response["image_table"], $user);
Run Code Online (Sandbox Code Playgroud)
当我在我的应用程序中使用该数组时,我使用此...
if (success == 1)
{
address = json.getJSONArray(TAG_IMAGE_TABLE);
for (int i = 0; i < address.length(); i++) {
JSONObject c = address.getJSONObject(i);
image = c.getString(TAG_IMAGE);
}
Run Code Online (Sandbox Code Playgroud)
它给我的结果如
json response: {"success":1,"image_table": [{"image":"iVBORw0KGgoAAA...................."
Run Code Online (Sandbox Code Playgroud)
当我在我的图像视图中使用此图像时,我会使用它
ImageView ivProperty = ((ImageView) myContentView.findViewById(R.id.image_property));
byte[] decodedString;
try {
decodedString = Base64.decode(image, Base64.URL_SAFE);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
ivProperty.setImageBitmap(decodedByte);
} catch (IOException e) {
// TODO …
Run Code Online (Sandbox Code Playgroud) 装饰RecyclerView以获得这样的外观和感觉的最佳和最简单的方法是什么?我正在开发一个旅行座位预订应用程序...我知道我可以使用gridlayout管理员的recyclerview来做这件事但是应该是什么步骤我不知道有一件事要注意每辆巴士有不同的座位安排
android android-gridlayout gridlayoutmanager recycler-adapter android-recyclerview
我正在开发一个心率监测应用程序,我正在从 BLE 设备读取数据,对于所有其他手机都没有问题,但对于 Note 8 等三星手机,它使用蓝牙版本 5.0 一段时间后会自动断开连接,我正在获取状态8
代码 :
用于连接
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mGattClient = device.connectGatt(this, false, mGattCallbacks, TRANSPORT_LE)
} else {
mGattClient = device.connectGatt(this, false, mGattCallbacks)
}
Run Code Online (Sandbox Code Playgroud)
//连接状态改变
override fun onConnectionStateChange(gatt: BluetoothGatt, status: Int, newState: Int) {
when (newState) {
BluetoothProfile.STATE_CONNECTED -> {
// this sleep is here to avoid TONS of problems in BLE, that occur whenever we start
// service discovery immediately after the connection is established
mGattClient?.discoverServices()
}
BluetoothProfile.STATE_DISCONNECTED -> {
Log.d(TAG,"Disconnected …
Run Code Online (Sandbox Code Playgroud) 我正在RecyclerView
和GridLayout
经理一起使用,以便像旅行一样预订座位.
我的问题是当我的列是随机的时候如何自动检测spancount?
我知道spanCount = recyclerViewWidth / singleItemWidth;
,但问题是singleItemWidth
不同的,因为座位宽度不同.
这是我想要的所需布局:
...但我现在得到这样的东西:
这是我用来安排座位布局的代码:
gridLayoutManager=new GridLayoutManager(this,totalRows, LinearLayoutManager.VERTICAL,
false);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
int rows=Integer.parseInt(upperlist.get(position).get("row"));
return (rows);///(int) (mRecyclerView.getMeasuredWidth()/ 10);
}
});
mRecyclerView.setLayoutManager( gridLayoutManager);
MyAdapter myAdapter=new MyAdapter(this,gridArray);
Run Code Online (Sandbox Code Playgroud)
... upperlist
保持这些值:
[{cols=8, seatNumber=29U, row=4, zindex=1},
{cols=6,seatNumber=23U, row=4, zindex=1},
{cols=4,seatNumber=21U,row=4, zindex=1},
{cols=2, seatNumber=11U, row=4, zindex=1},
{cols=0,seatNumber=9U,row=4, zindex=1},
{cols=8,seatNumber=25U, row=2, zindex=1},
{cols=6,seatNumber=17U, row=2, zindex=1},
{cols=4,seatNumber=13U, row=2, zindex=1},
{cols=2,seatNumber=5U, row=2, zindex=1},
{cols=10, seatNumber=D2U,row=2, zindex=1},
{cols=0, seatNumber=1U, row=2, …
Run Code Online (Sandbox Code Playgroud) 我正在开发一个需要印度卢比符号的应用程序我的字符串是这样的
result = Rs 0 我的代码替换此字符串是
if (result.contains("Rs")) {
result.replace("Rs","?");
MenuItem balance = menu.findItem(R.id.action_balance);
SpannableString s = new SpannableString(result);
s.setSpan(new ForegroundColorSpan(Color.BLUE), 0, s.length(), 0);
balance.setTitle(s);
}
Run Code Online (Sandbox Code Playgroud)
result.replace( "RS", "₹"); 是一个我从网上复制的字符串,我也是这样做的
<string name="Rs">\u20B9</string>
result.replace("Rs",getResources().getString(R.string.RS));
Run Code Online (Sandbox Code Playgroud)
但是什么都不起作用......除了请回答之外还有其他任何选择
android ×10
android-menu ×1
bluetooth ×1
facebook ×1
fbsdk ×1
google-plus ×1
kotlin ×1
mysql ×1
php ×1
react-native ×1
string ×1
unicode ×1