我正试图在片段中显示来自Google Maps API V2的地图.我尝试使用SupportMapFragment,但我无法获得预期的输出.我也是这个平台的初学者!我真正想要的只是一种将Google Maps API V2 for Android中的地图放入片段中的方法.请分享您的想法和参考.
提前致谢 !
我是iphone开发的新手,我需要在标签栏中放置一个自定义图像图标.但它只显示默认颜色(黑色和蓝色).帮助我克服这个bug朋友......?
今天我在android中遇到了一个问题surfaceview for camera customization.我尝试了下面的代码.
拍摄图像时出现问题,它会停止相机预览并且不会返回活动.
以下代码将在程序中实现.我从stackoverflow上的现有引用中获取此代码
支持班级.
public class AndroidCameraSurfaceview extends Activity implements
SurfaceHolder.Callback {
TextView testView;
Camera camera;
SurfaceView surfaceView;
SurfaceHolder surfaceHolder;
boolean preview;
PictureCallback rawCallback;
ShutterCallback shutterCallback;
PictureCallback jpegCallback;
int displayheight, displaywidth;
Camera.PreviewCallback previewCallback;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.camerasurfaceview);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
jpegCallback = new PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
Bundle …Run Code Online (Sandbox Code Playgroud)android android-intent android-camera android-5.1.1-lollipop
我是Android App开发的新手.
我正在我的应用程序中实现GCM(Google Cloud Messaging).
当我尝试将值发布到我的URL时,我收到一个错误:
the Stack Trace Error and MMUMapper Error, fail to register MVA, unsupported format(0x5) and invalid operation for Unregister MVA with VA.
Run Code Online (Sandbox Code Playgroud)
有没有人有办法解决吗?请帮助我.
我开始使用约束布局,仅在编译设计文件时遇到断言错误,就会发生此问题。解决此问题的正确方法是什么?我搞砸了一天。这是我的XML设计。
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cL_Layout"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@color/card_background">
<android.support.constraint.Guideline
android:id="@+id/gL_right_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.95" />
<android.support.constraint.Guideline
android:id="@+id/gL_vertical_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.50364965" />
<android.support.constraint.Guideline
android:id="@+id/gL_bottom_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="1.0" />
<android.support.constraint.Guideline
android:id="@+id/gL_image_size_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.3" />
<ImageView
android:id="@+id/imgVw_AddClips_recVw_icon"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:adjustViewBounds="true"
android:background="@drawable/qik_highlights_shape"
android:contentDescription="@string/dummy_content"
android:scaleType="fitCenter"
android:src="@drawable/bg_cloud_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gL_image_size_margin"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.ibot.cyranoapp.customview.TextViewFont
android:id="@+id/txtIp_recVw_AddClips_Name_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/recVw_Template_channel"
android:textAllCaps="false"
android:textColor="@color/fa_preview_button_text_grey"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/gL_image_size_margin"
app:layout_constraintTop_toTopOf="parent" />
<com.ibot.cyranoapp.customview.TextViewFont
android:id="@+id/txtIp_recVw_Components_Name_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="8dp"
android:text="@string/recVw_Template_Components"
android:textAllCaps="false" …Run Code Online (Sandbox Code Playgroud) 我正在使用 Exoplayer 以横向模式录制视频并以纵向模式显示预览,同时连续录制视频,更改方向,反之亦然。一旦进入,播放器预览就会显示空白屏幕。我使用 Exoplayer 2.9.6 作为 Gradle 的依赖项并使用 android 操作系统版本 10。
E/BufferQueueProducer:[SurfaceTexture-0-22659-29] setMaxDequeuedBufferCount:请求的缓冲区计数 2 小于最小值 3
E/Surface:IGraphicBufferProducer::setBufferCount(2) 返回无效参数 E/ACodec:native_window_set_buffer_count 失败:无效参数 (22)
E/ExoPlayerImplInternal:内部运行时错误。java.lang.IllegalArgumentException 在 android.media.MediaCodec.native_setSurface(本机方法) 在 android.media.MediaCodec.setOutputSurface(MediaCodec.java:2042) 在 com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutputSurfaceV23(MediaCodecVideoRenderer.java :1014)在com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setSurface(MediaCodecVideoRenderer.java:422)在com.google.android.exoplayer2.video.MediaCodecVideoRenderer.handleMessage(MediaCodecVideoRenderer.java:387)在com.google。 android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:864) 在 com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:835) 在 com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java: 817) 在 com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:330) 在 android.os.Handler.dispatchMessage(Handler.java:103) 在 android.os.Looper.loop(Looper.java:237) )在 android.os.HandlerThread.run(HandlerThread.java:67)
在应用程序中显示ios6中的可达性错误.任何人都可以帮我解决可达性ios6中的这个错误,需要做的事情.
@implementation Reachability
static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
{
#pragma unused (target, flags)
NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCall9back");
//We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively
// in case someon uses the Reachablity object in a different thread.
Reachability* noteObject = (Reachability*) info;
// Post a notification to notify the client that the network reachability changed. …Run Code Online (Sandbox Code Playgroud) 当我尝试构建应用程序时,它将显示android.view.InflateException在FloatingActionButton中?我真的不知道导致错误的原因.
Login.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="@drawable/bg_image" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/lLayout_logincontainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="40dp"
android:orientation="vertical">
<ImageView
android:layout_width="130dp"
android:layout_height="125dp"
android:src="@drawable/project"/>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<EditText
android:id="@+id/aTxt_UserName"
style="@style/edittextstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="User Name"
android:imeOptions="actionNext"
android:textColorHint="@color/white"
>
</EditText>
</android.support.design.widget.TextInputLayout>
<!-- Password Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/eTxt_PassWord"
style="@style/edittextstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="textPassword"
android:textColorHint="@color/white"
android:textColor="@color/white" />
</android.support.design.widget.TextInputLayout>
<android.support.v7.widget.AppCompatButton
android:id="@+id/btn_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="3dp"
android:background="@drawable/button_shape"
android:padding="12dp"
android:text="Login"
android:textAllCaps="false"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout> …Run Code Online (Sandbox Code Playgroud) android android-layout floating-action-button android-api-levels
当试图在左侧和右侧添加导航按钮时,它没有显示?这是我用过的代码,这有什么不对吗?
这是我在appdelegate中添加导航栏的方式,
UIViewController *viewController1 = [[logyFirstViewController alloc] initWithNibName:@"logyFirstViewController" bundle:nil];
UIViewController *viewController2 = [[logySecondViewController alloc] initWithNibName:@"logySecondViewController" bundle:nil];
UIViewController *viewController3 = [[record alloc] initWithNibName:@"record" bundle:nil];
UIViewController *viewController4 = [[searchview alloc] initWithNibName:@"searchview" bundle:nil];
UIViewController *viewController5 = [[profilde alloc] initWithNibName:@"profilde" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = @[viewController1, viewController2, viewController3, viewController4, viewController5];
navigationController = [[UINavigationController alloc] initWithRootViewController:self.tabBarController];
self.navigationController.navigationBar.barStyle=UIBarStyleDefault;
[navigationController.navigationBar setAlpha:0.8f];
[self.window addSubview:[navigationController view]];
button4 = [UIButton buttonWithType:UIButtonTypeCustom];
[button4 setFrame:CGRectMake(0.0f, 0.0f, 25.0f, 25.0f)];
[button4 addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
[button4 setImage:[UIImage imageNamed:@"del.png"] forState:UIControlStateNormal];
UIBarButtonItem *random1 = …Run Code Online (Sandbox Code Playgroud) 我使用 Ubuntu 16.04 进行 android 开发,最近我从稳定频道更新了 Android Studio 2.3。目前我从 IDE 中发现了一些错误。下面提到了错误:我创建了新项目,项目资源管理器中显示的包和类文件非常奇怪。请参阅下面的图片,它们将清楚地传达我想说的内容。如何更改包在资源管理器中显示的模式。
我需要从 java 类加载一个静态 PDF 文档,该文档在 WebLogic 12c 上的 J2EE Web 应用程序中运行;然而,尽管我的代码可以在 Tomcat 中运行,但当尝试在 WebLogic 12c(WebLogic Server 版本:12.2.1.2.0)中运行它时,我收到一个服务器错误,指出找不到 PDF 文件(java.io.FileNotFoundException)。
我正在使用 Apache 的 PDF 库 PDFBox 版本 2.0.8 加载我创建的可填写 PDF 文件,然后用数据填充该可填写 PDF。我的代码在 Tomcat 中运行良好,但在部署到 WebLogic 12c 时找不到 pdf 文件。
-这似乎是因为当 EAR 文件部署到 WebLogic 12c 时,WAR 文件中的内容(所有应用程序代码/文件,包括可填写的 PDF 文件)仍然存档在 WebLogic 创建的 jar 文件中,而不是爆炸了。
我的应用程序使用标准的 Maven 应用程序结构,因此与所有静态文件都是标准的,我已将 PDF 文件放在静态资源目录中:
src/主/资源/
在我的 pom.xml 文件中,我有以下内容,它将 /src/main/resources/ 文件夹中的所有 pdf 文件构建到 WAR 文件的类路径根文件夹中。
<resource>
<directory>${basedir}/src/main/resources/</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
<include>**/*.pdf</include>
</includes>
</resource>
Run Code Online (Sandbox Code Playgroud)
当我构建 WAR 和 EAR 文件时,pdf 文件确实被复制到应用程序类文件的根文件夹中。 …
当我尝试使用以下自定义单元格编码时,它显示错误.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"SimpletablcellCell";
SimpletablcellCell *cell = (SimpletablcellCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpletablcellCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.nameLabel.text = [ar objectAtIndex:indexPath.row];
cell.thumbnailImageView.image = [UIImage imageNamed:[ar1 objectAtIndex:indexPath.row]];
cell.prepTimeLabel.text = [ar objectAtIndex:indexPath.row];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
错误消息
'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/apple/Library/Application Support/iPhone Simulator/6.0/Applications/FE02B3A1-C40C-4FAC-BBA6-B245350F3754/SImpleTab.app> (loaded)' with name 'SimpletablcellCell''
*** First throw call stack:
(0x1c8f012 0x10cce7e 0x1c8edeb 0x22ffac 0x23198d …Run Code Online (Sandbox Code Playgroud) 如何ArrayList在android中将变量从一个类调用到另一个类?我构架了ArrayListfrom Json Service,我尝试了很多方法,但是在如何将数组列表从一个类调用到另一个类时遇到了问题。我使用以下代码来构建数组列表HashMap:
下面显示的是 FirstActivityCLass
protected Integer doInBackground(Void... arg0) {
try {
JSONObject e = null;
System.out.println("In Background...");
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
.detectAll().penaltyLog().build();
StrictMode.setThreadPolicy(policy);
String API = "http://traininglabs.com/nic/a-remainders-list.php?email="+email;
System.out.println(API);
JSONObject loginjson = JSONfunctions1.getJSONfromURL(API);
responseArray=loginjson.getJSONArray("user");
mylist=new ArrayList<HashMap<String,String>>();
for (int i = 0; i < responseArray.length(); i++)
{
map = new HashMap<String, String>();
JSONObject obj= responseArray.getJSONObject(i);
**String ss = obj.getString("id");
map.put("id", obj.getString("id"));**
map.put("state", obj.getString("status"));
map.put("entity", obj.getString("company"));
map.put("date", obj.getString("adate"));
s1 = e.getString("state");
s2 = e.getString("entity");
s3 …Run Code Online (Sandbox Code Playgroud) android ×8
iphone ×4
ios ×2
ios6 ×2
java ×2
arraylist ×1
exoplayer ×1
google-maps ×1
hashmap ×1
json ×1
pdfbox ×1
uitabbar ×1
uitableview ×1
weblogic12c ×1
xcode4.5 ×1