小编Roh*_*hit的帖子

如何在Eclipse中导入Android Studio项目?

我已经在Android Studio中创建了一个项目,现在我想将该项目导入Eclipse,有将eclipse转换为Android Studio的选项,但是如何将Android studio转换为Eclipse?

eclipse android android-studio

49
推荐指数
2
解决办法
5万
查看次数

Android Zxing改变方向为肖像

在阅读了几个关于这个问题的问题和帖子后,我正在尝试旋转Zxing显示器.按照说明操作后,显示屏确实旋转,但扫描仪的矩形没有按照应有的位置放置(如附图所示).

这就是我所做的:

  1. 在CameraConfigurationManager中:

    camera.setDisplayOrientation(90);
    
    Run Code Online (Sandbox Code Playgroud)
  2. 在DecodeHandler.java中

    byte[] rotatedData = new byte[data.length];
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++)
                 rotatedData[x * height + height - y - 1] = data[x + y * width];
         }
    int tmp = width;         
    width = height;
    height = tmp;
    
    Run Code Online (Sandbox Code Playgroud)
  3. 在CameraManager.java中:

    rect.left = rect.left * cameraResolution.y / screenResolution.x;
    rect.right = rect.right * cameraResolution.y / screenResolution.x;
    rect.top = rect.top * cameraResolution.x / screenResolution.y;
    rect.bottom = rect.bottom …
    Run Code Online (Sandbox Code Playgroud)

android zxing

44
推荐指数
5
解决办法
4万
查看次数

javaee-api和javaee-web-api有什么区别?

我意识到这些依赖关系是编译Java servlet规范所必需的,等等,但我不清楚它们之间的区别,以及何时我应该使用一个而不是另一个.

他们之间有什么区别?是另一个的超集吗?

<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>

dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-web-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

java api

26
推荐指数
1
解决办法
2万
查看次数

Gridview单击自定义列表视图内部不起作用

我在Listview中使用gridview,但我有一个可聚焦的问题.

我已经设置了gridview的宽度,但是我填写了gridview的一些项目,gridview的左侧空格(这是空白)表示未在listview中填充gridview的项目.如果我点击它,它不会执行listitem点击

在此输入图像描述

如图像中所示,如果在列表项中的任何位置单击它,我想执行listview项单击.我想获得一个listitem点击.

但是,当我点击ListView项目,即,GridViewListItem点击是不工作...

public class History extends Activity {

    String name, id, description, count, total;

    ArrayList<String> TAG_ID = new ArrayList<String>();
    ArrayList<String> TAG_COFFEESHOP_NAME = new ArrayList<String>();
    ArrayList<String> TAG_COUNT = new ArrayList<String>();
    ArrayList<String> TAG_TOTAL = new ArrayList<String>();

    Context context;
    JSONArray CoffeeUser = null;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listlayout);
        ListView listView = (ListView) findViewById(R.id.listnew);
        listView.setAdapter(new MyCustomAdapter());
        listView.setTextFilterEnabled(true);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener()
        {
            public void onItemClick(AdapterView<?> paramAnonymousAdapterView, View paramAnonymousView, int paramAnonymousInt, long paramAnonymousLong)
            {
                Intent intent …
Run Code Online (Sandbox Code Playgroud)

android listview gridview

7
推荐指数
1
解决办法
3096
查看次数

如何在android中获取动态生成的图像名称

我想在点击动态创建的图像时获取图像名称......

 for(int i=0;i<list.size();i++)
    {
        final ImageButton b=new ImageButton(this);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(70, 70);
        layoutParams.setMargins(5, 5, 0, 0); // left, top, right, bottom
        b.setLayoutParams(layoutParams);
        Resources res = getResources();
        int resourceId = res.getIdentifier("_"+list.get(i).toString(), "drawable", getPackageName() );
        b.setImageResource( resourceId );
        b.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
              //at here i want to get the selected image name


            }
        });
        rowoptions.addView(b);
    }    
Run Code Online (Sandbox Code Playgroud)

android

6
推荐指数
1
解决办法
1286
查看次数

如何在android中闪烁通知图标?[DONE]

我搜索了很多东西: 如何在谷歌地图上显示图标闪烁

但根据这个我没有找到如何闪烁通知图标闪烁

我想在这上面闪烁图标

 int icon = R.drawable.ic_launcher;
long when = System.currentTimeMillis();
notificationManager = (NotificationManager) context
        .getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(icon, "Hi M rohit", when);
String title = context.getString(R.string.app_name);
Intent notificationIntent = new Intent(context, Home.class);
// set intent so it does not start a new activity
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, title, "Rohit", intent);
//notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.defaults = Notification.DEFAULT_ALL;
notificationManager.notify(NOTIFICATION, notification);
Run Code Online (Sandbox Code Playgroud)

notifications android blink

5
推荐指数
1
解决办法
4752
查看次数

循环遍历AngularJS中的JSON元素

我有以下ng-repeat代码:

<li ng-repeat="vid in vids | filter:query | orderBy:orderProp">
       {{vid.title}}
</li>
Run Code Online (Sandbox Code Playgroud)

我的问题是,如果我不知道密钥名称,我可以循环访问vid并打印出每个密钥和值吗?

那么我将如何在PHP中做到这一点:

<?php
foreach ($vids as $key => $val) {
    echo $key . "=" . $val;
}
?>
Run Code Online (Sandbox Code Playgroud)

php json angularjs

4
推荐指数
1
解决办法
2022
查看次数

防止在清除的应用程序上删除数据库或共享首选项

我想防止清除共享首选项或数据库,以便仅在卸载应用程序时清除。如何在应用程序上确保共享首选项的安全。明确?

图片

database android sharedpreferences

4
推荐指数
1
解决办法
3915
查看次数

如何在ubuntu中设置在Android Studio中格式化的文本

http://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf

如同我们在Eclipse中按"ctrl + alt + f"然后所有文本自动格式化.怎么在ubuntu?

如果我们在ubuntu上使用CTL + ALT + L,那么它会关闭logg

怎么在Android Studio ubuntu?

android android-studio

2
推荐指数
1
解决办法
1385
查看次数

寻求酒吧进度无法正常显示

我设置了搜索栏的属性.它达到一个过程,但其过程未达到1,如下图所示

在此输入图像描述

 sbpassangers.setProgress(1); //set this at onCreate
Run Code Online (Sandbox Code Playgroud)

xml:

<SeekBar
      android:id="@+id/sBpassangers"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_toLeftOf="@+id/tvPassengers"
      android:layout_toRightOf="@+id/ivPhone"
      android:layout_weight="2"
      android:paddingBottom="3dp"
      android:paddingLeft="2dp"
      android:paddingTop="3dp" />
Run Code Online (Sandbox Code Playgroud)

java代码:

sbpassangers.setProgress(1);
    sbpassangers.setMax(sb1.getProgress());
    tvtaxipassangers.setText(Integer.toString(1));
    //sb1.setMax(9);
    //sb1.setProgress(2); // Set it to zero so it will start at the left-most edge
    sbpassangers.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            seekBar.setProgress(progress);
         if(progress == 0){
             seekBar.setProgress(1);
         }
            tvtaxipassangers.setText(Integer.toString(seekBar.getProgress()));

        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {}

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {}

    });
Run Code Online (Sandbox Code Playgroud)

应该是这样的:

在此输入图像描述

请帮忙解决这个问题

android seekbar

2
推荐指数
1
解决办法
3173
查看次数