我有一个错误:
03-01 11:20:43.453: E/AndroidRuntime(31235): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.qz.Blaze.ServiceStarted flg=0x10 } in com.qz.Blaze.$ServiceStartedReceiver@423540f0
03-01 11:20:43.453: E/AndroidRuntime(31235): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:766)
03-01 11:20:43.453: E/AndroidRuntime(31235): at android.os.Handler.handleCallback(Handler.java:615)
03-01 11:20:43.453: E/AndroidRuntime(31235): at android.os.Handler.dispatchMessage(Handler.java:92)
03-01 11:20:43.453: E/AndroidRuntime(31235): at android.os.Looper.loop(Looper.java:137)
03-01 11:20:43.453: E/AndroidRuntime(31235): at android.app.ActivityThread.main(ActivityThread.java:4921)
03-01 11:20:43.453: E/AndroidRuntime(31235): at java.lang.reflect.Method.invokeNative(Native Method)
03-01 11:20:43.453: E/AndroidRuntime(31235): at java.lang.reflect.Method.invoke(Method.java:511)
03-01 11:20:43.453: E/AndroidRuntime(31235): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
03-01 11:20:43.453: E/AndroidRuntime(31235): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
03-01 11:20:43.453: E/AndroidRuntime(31235): at dalvik.system.NativeStart.main(Native Method)
03-01 11:20:43.453: E/AndroidRuntime(31235): Caused by: java.lang.IllegalStateException: Recursive entry to executePendingTransactions
03-01 11:20:43.453: E/AndroidRuntime(31235): …Run Code Online (Sandbox Code Playgroud) android android-fragments android-viewpager android-fragmentactivity android-nested-fragment
我正在使用5页的片段寻呼机适配器.并设置适配器以查看寻呼机,如下所示
public class xxx extends FragmentPagerAdapter
{
final int PAGE_COUNT_LOGGED_IN = 6;
final int PAGE_COUNT_LOGGED_OUT = 2;
TextView oTextView = null;
LayoutInflater inflater = null;
PagerTabStrip m_oPageTabStrip = null;
String m_strTab = null;
String[] m_strArray = null;
Context m_oContext = null;
/** Constructor of the class */
public xxxx (Context context, android.support.v4.app.FragmentManager oFragmentManager)
{
super (oFragmentManager);
m_oContext = context;
}
/** This method will be invoked when a page is requested to create */
@Override
public Fragment getItem(int arg0)
{ …Run Code Online (Sandbox Code Playgroud) android adapter android-fragments android-viewpager fragmentpageradapter
我在 Gradle 中输入了以下代码。
///start
applicationVariants.all { variant ->
variant.outputs.each { output ->
println("Roop: mappingFile: ${output.outputFile}")
}
variant.assemble.doLast {
// doLast {
File dir = new File("${project.projectDir}/out1")
dir.mkdirs()
println("Roop: copy")
variant.outputs.each { output ->
File file = output.outputFile
println("Roop: file:" + file)
}
}
}
Run Code Online (Sandbox Code Playgroud)
现在,当我从 android studio 执行 Build Apk 时,在创建 apk后会执行 Variant.assemble.doLast 。但是如果我执行Build Bundle ,则不会调用相同的 doLast 。
为什么没有为 BuildBundle 调用 doLast 的任何信息?
我有一个代码,我将从相机捕获的图像设置为矢量,然后使用图像适配器显示捕获的图像。但是我在 OnActivityResut 中得到的结果代码为 0,数据为 null。下面是启动相机的代码,它有效,即我使用相机单击图像
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
Run Code Online (Sandbox Code Playgroud)
然后我使用 OnActivityResult 如下
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK)
{
ImageView photo = (ImageView) data.getExtras().get("data");
m_oVectorOfImages.add(photo);
m_oImageAdapter.notifyDataSetChanged();
}
}
Run Code Online (Sandbox Code Playgroud)
我能知道为什么 resultcode 为 0 而 data 为 null 吗?
android android-intent android-camera android-camera-intent android-activity
我有一个问题,我应该知道gridview每行显示的不同设备的数量.像gridview平板电脑每行的数量,WVGA手机..因为他们的屏幕宽度不同..有一个代码来检查这个?
我有一个用户名,TextView低于该用户名EditText和密码相同EditText.我需要将各个设备更改为Holo主题..我已尝试将父设置style.xml为
parent="@android:style/Theme.Holo.
Run Code Online (Sandbox Code Playgroud)
parent="@android:style/Widget.Holo.Light.EditText"
但没有用.任何人都有答案?
嗨,我得到了答案.原因是调用此对话框的活动主题为android:theme ="@ android:style/Theme.Translucent.NoTitleBar"在manifest ..i中删除并添加在oncreate中,并且有来自editText的全息!!!!
我有一个relativelayout包含一个progressbar和一个Loading textview..我需要progressbar和文本视图锥体在相对布局的中心.但它更多的是向右而不是在中心.下面是我的代码..
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="26dp"
android:layout_gravity="bottom"
android:background="@drawable/border">
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:id="@+id/progressBar"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/TextViewProgress"
android:text="Loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16dp"
android:layout_toRightOf="@+id/progressBar"
/>
Run Code Online (Sandbox Code Playgroud) 我创建了一个mime类型的活动,如下图所示.
<activity android:name=".xxxx"
android:launchMode="singleTop"
android:excludeFromRecents="true"
android:configChanges="orientation|screenSize|keyboardHidden"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="xxxx.xxxx.net"></data>
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CHOOSER" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="xxxx.xxxx.net"/>
<data android:mimeType="image/*" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
现在,当用户点击照片并进入图库并分享我的应用程序即将到来,当他点击它时我能够启动上述活动...现在我的问题是如何获得该图像的路径?
我有一个来自服务器的JSON,如下所示
{
"XXXX": {
"type": "RSS",
"value": ""
},
"YYYY": {
"type": "String",
"value": ""
},
"ZZZZ": {
"type": "String",
"value": ""
}
}
Run Code Online (Sandbox Code Playgroud)
现在我需要String在所有XXXX,YYYY和ZZZZ的字段中添加值.
我正在使用eclipse,我需要更改XXXX以及YYYY和ZZZZ中"value"的值,我需要添加字段
{
"MMMM": {
"type": "Image",
"value": "a7e8bec0-87ed-11e2-aa2e-52540025ab96_2_1362746556"
}
}
Run Code Online (Sandbox Code Playgroud)
ZZZZ之后.请让我知道怎么做.